F
FeFi
Brief description of problem - Col A contains data in random cells down the
sheet, i.e., A1, A23, A25, A86, etc., each of which is common to data found
in rows in adjoining columns. In this example I need to copy A1 to A2 thru
A22; copy A23 to A24; A25 to A26 thru A85; etc. If I copy the cell, use
"End" "Down" to find the next cell with data, use the "Up" arrow key to go to
the blank cell above, paste the data, then use "End" Down" to go to the next
cell to be copied, everything if fine. I created a macro doing this (using
relative reference) but it doesn't work correctly. I'm sure it has to do
with the cell references but I don't know how to edit it. This procedure is
required monthly on a very large spreadsheet (data in Col A is never in the
same rows) and I want to be able to loop this in order to save time. The
macro I created is shown below - can anyone fix it to do what I want?
Sub Copy_Code_to_Blanks()
'
' Copy_Code_to_Blanks Macro
' Macro recorded 3/13/2008 by XXXXXXXXX
'
'
Selection.Copy
Range(Selection, Selection.End(xlDown)).Select
ActiveCell.Range("A1:A22").Select
ActiveSheet.Paste
Selection.End(xlDown).Select
End Sub
sheet, i.e., A1, A23, A25, A86, etc., each of which is common to data found
in rows in adjoining columns. In this example I need to copy A1 to A2 thru
A22; copy A23 to A24; A25 to A26 thru A85; etc. If I copy the cell, use
"End" "Down" to find the next cell with data, use the "Up" arrow key to go to
the blank cell above, paste the data, then use "End" Down" to go to the next
cell to be copied, everything if fine. I created a macro doing this (using
relative reference) but it doesn't work correctly. I'm sure it has to do
with the cell references but I don't know how to edit it. This procedure is
required monthly on a very large spreadsheet (data in Col A is never in the
same rows) and I want to be able to loop this in order to save time. The
macro I created is shown below - can anyone fix it to do what I want?
Sub Copy_Code_to_Blanks()
'
' Copy_Code_to_Blanks Macro
' Macro recorded 3/13/2008 by XXXXXXXXX
'
'
Selection.Copy
Range(Selection, Selection.End(xlDown)).Select
ActiveCell.Range("A1:A22").Select
ActiveSheet.Paste
Selection.End(xlDown).Select
End Sub