• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

VBA to paste a cell value in multiple sheets

Mr.Karr

Member
Hi

Can anyone please provide a code snippet to paste a cell value in multiple sheets (but same cell with all sheets). Is this possible with array?

Code:
Worksheets("Home").Range("A1").Copy _
    Destination:=Worksheets(Array("Sheet1", "Sheet2")).Range("H16")

Copy a value from home tab cell A1 & paste that into sheet1, sheet2 (cell H16)

Thanks
 
Please try below code

Code:
Sub TEST()
Dim sht As Worksheet
Sheets("Home").Range("A1").Copy
For Each sht In Worksheets
sht.Range("H16").PasteSpecial xlPasteValues
Next
Application.CutCopyMode = False
End Sub
 
Try below code
'Sheets selection should be done before running macro
Code:
Sub TEST()
Dim sht As Worksheet
Sheets("sheet1").Range("a1").Copy
'Sheets selection should be done before running macro
Selection.Range("H16").PasteSpecial xlPasteValues
Application.CutCopyMode = False
End Sub
 
Back
Top