Home |
Search |
Today's Posts |
#1
|
|||
|
|||
Paste data from another worksheet
I am currently trying to paste information from a main worksheet onto different worksheets based on the divisions. I can get it to copy the data, but cannot get it over to the new worksheet. Here is the code:
Private Sub CommandButton1_Click() Dim a As Integer, b As Integer, c As Integer, rng As Range, div As String Set rng = Range("A3:I1002") a = 3 b = 2 c = 2 For a = 3 To 20 div = Cells(a, 8).Value If Cells(a, 1).Value < 10000 Then Exit For End If Select Case div Case "Mold Build" rng.Rows(a - 2).Copy Worksheets(2).Activate **** This is where the paste should go, but I can't get it to work b = b + 1 Worksheets(1).Activate Case Else rng.Rows(a - 2).Copy Worksheets(3).Activate **** This is where the paste should go, but I can't get it to work c = c + 1 Worksheets(1).Activate End Select Next a End Sub |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
How to move data on worksheet | Excel Discussion (Misc queries) | |||
How can I show data under a Chart that I inserted in a worksheet? | Charts and Charting in Excel | |||
extract data from worksheet | Excel Worksheet Functions | |||
How do I paste data into filtered list in Excel? | Excel Discussion (Misc queries) | |||
sending data from one cell to another (not using copy & paste) | Excel Worksheet Functions |