MrExcel Publishing
Your One Stop for Excel Tips & Solutions

macro code


Posted by Graham on February 01, 2002 11:29 AM

Hey I created a macro to collect information from one sheet then paste it onto another sheet to create a database. Every time the macro is run it should paste the new information onto the next coloum. When I run the macro it selects the range then moves onto the next page selects the cells to paste onto but doesnt paste?
this is the macro:
sheet16_start = "B1" 'Start Cell for Second Sheet.
Sheet16.Activate

Range(sheet16_start).Activate

Cell = "foo"
Range(sheet16_start).Activate


Do Until Cell = ""
Cell = ActiveCell.Text
If Cell <> "" Then
ActiveCell.Offset(0, 1).Select
End If
Loop

For i = 1 To 20
Sheet26.Activate
Sheet26.Range("B" & i).Select
Sheet16.Activate
ActiveCell.Value = txt
ActiveCell.Offset(1, 0).Select
Next

End Sub


Posted by Larry Kramer on February 01, 2002 11:50 AM

It looks like you need to insert

txt=activecell

after you select the cell on sheet26
(You also have to Dim txt appropriately)