Forum Discussion
Bob Hilton
Jan 05, 2017Copper Contributor
Using VBA Macro to copy data from 1 worksheet to another
I have 10 worksheets in the same format labled S1 thru S10. I have another worksheet for data entry. Each row contains data to be copied to one of the other 10 worksheets. The destination is defin...
Wyn Hopkins
Jan 06, 2017MVP
Hi Bob
Does the input sheet get cleared out after the data is copied to the other sheets?
- Bob HiltonJan 06, 2017Copper ContributorYes.
- Wyn HopkinsJan 06, 2017MVP
Hopefully this will get you started in the right direction
There's all sorts of considerations to take into account but this is a basic starting point...
Sub CopyToSheets()
'Dim c As Range
Dim strDestinationSheet As StringFor Each c In Range("ColDestination")
strDestinationSheet = c.Value
c.EntireRow.Copy
Sheets(strDestinationSheet).Select
Range("A1").Select
ActiveSheet.Paste
Selection.EntireRow.Insert
Next c
End Sub- Bob HiltonJan 07, 2017Copper ContributorThank you Wyn. You got me unstuck and movinig in the right direction!