Hello, I hope someone can help me with my code. I have a workbook that splits data from a Main worksheet into multiple worksheets based on the data in column A. After that macro runs, I'm trying to take data from another sheet and copy/paste into all the sheets I just created that contains a "key" to the data in each worksheet. For some reason it copies the rows, but won't paste onto the other worksheets. I'm new at this, and am cobbling this together bit by bit.
VBA Macro to Insert Rows into All Visible Sheets
- vaflyfisher
- Thread is marked as Resolved.
-
-
-
Hello VA,
Are you looking at copy/pasting rows 1-13 from sheet37 (assume this is the sheet code) to all the other sheets starting at A1? If so, try the code amended as follows:-
Code
Display MoreSub TestCopy() Dim ws As Worksheet, sh As Worksheet Set sh = Sheet1 Application.ScreenUpdating = False For Each ws In Worksheets If ws.Name <> "Sheet37" Then sh.Rows("1:13").Copy ws.[A1] End If Next ws Application.ScreenUpdating = True End Sub
You'll need to change Sheet37 to the actual name of your source sheet.
I hope that this helps.
Cheerio,
vcoolio.
-
Hello VA,
I've just realised that in the code above I've mistakenly set the sh variable to Sheet1. It should be 37.
Cheerio,
vcoolio.
-
Cheerio! Thanks, that did it!
-
You're welcome VA. I'm glad to have been able to assist.
Cheerio,
vcoolio.
-
Participate now!
Don’t have an account yet? Register yourself now and be a part of our community!