Jan 05 2017
11:28 AM
- last edited on
Jul 25 2018
09:33 AM
by
TechCommunityAP
Jan 05 2017
11:28 AM
- last edited on
Jul 25 2018
09:33 AM
by
TechCommunityAP
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 defined in a cell in that row, e.g. S5.
What is the syntax to paste the data to the desired worsheet? Any help is greatly appreciated.
Jan 05 2017 05:32 PM
Hi Bob
Does the input sheet get cleared out after the data is copied to the other sheets?
Jan 05 2017 08:19 PM
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 String
For 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
Jan 07 2017 07:36 AM