Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I have a downloaded report that does not have data on one row. I need to
copy 5 cols. of data from one row to the row above then move 4 rows down and repeat. I've done this with Lotus years ago, but never with Excel Thanks, |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
If you mean you want to remove all blank rows in a report
Sub RemoveRows() On Error Resume Next Columns(1).SpecialCells(xlBlanks).EntireRow.Delete On Error goto 0 End Sub -- Regards, Tom Ogilvy "Josef" wrote in message ... I have a downloaded report that does not have data on one row. I need to copy 5 cols. of data from one row to the row above then move 4 rows down and repeat. I've done this with Lotus years ago, but never with Excel Thanks, |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Josef,
Assuming you know where to start and when to stop, here's an example that starts at row 2 and loops 3 times. Geof. Sub testcopy() Dim lngCounter As Long Dim lngCurrentRow As Long Dim lngTotal As Long lngCurrentRow = 2 lngTotal = 3 For lngCounter = 1 To lngTotal Range("A" & lngCurrentRow, "E" & lngCurrentRow).Copy Destination:=Range("A" & lngCurrentRow).Offset(-1, 0) lngCurrentRow = lngCurrentRow + 4 Next lngCounter End Sub -----Original Message----- I have a downloaded report that does not have data on one row. I need to copy 5 cols. of data from one row to the row above then move 4 rows down and repeat. I've done this with Lotus years ago, but never with Excel Thanks, . |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Geof,
Thanks, it worked like great. I guess you can't copy macros into the macro editor? I retyped it and worked. Thanks again "Geof Wyght" wrote: Josef, Assuming you know where to start and when to stop, here's an example that starts at row 2 and loops 3 times. Geof. Sub testcopy() Dim lngCounter As Long Dim lngCurrentRow As Long Dim lngTotal As Long lngCurrentRow = 2 lngTotal = 3 For lngCounter = 1 To lngTotal Range("A" & lngCurrentRow, "E" & lngCurrentRow).Copy Destination:=Range("A" & lngCurrentRow).Offset(-1, 0) lngCurrentRow = lngCurrentRow + 4 Next lngCounter End Sub -----Original Message----- I have a downloaded report that does not have data on one row. I need to copy 5 cols. of data from one row to the row above then move 4 rows down and repeat. I've done this with Lotus years ago, but never with Excel Thanks, . |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Josef,
You're welcome. You should be able to copy & paste the code. It might have some junk. I commented out many statements. Longer lines had carriage returns when posted You might have had the goofy characters. Geof. -----Original Message----- Geof, Thanks, it worked like great. I guess you can't copy macros into the macro editor? I retyped it and worked. Thanks again "Geof Wyght" wrote: Josef, Assuming you know where to start and when to stop, here's an example that starts at row 2 and loops 3 times. Geof. Sub testcopy() Dim lngCounter As Long Dim lngCurrentRow As Long Dim lngTotal As Long lngCurrentRow = 2 lngTotal = 3 For lngCounter = 1 To lngTotal Range("A" & lngCurrentRow, "E" & lngCurrentRow).Copy Destination:=Range("A" & lngCurrentRow).Offset(-1, 0) lngCurrentRow = lngCurrentRow + 4 Next lngCounter End Sub -----Original Message----- I have a downloaded report that does not have data on one row. I need to copy 5 cols. of data from one row to the row above then move 4 rows down and repeat. I've done this with Lotus years ago, but never with Excel Thanks, . . |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
macro - how to move to a specific cell and repeat | Excel Worksheet Functions | |||
repeat two rows macro please | New Users to Excel | |||
copy a worksheet to new one with repeat rows 5 times | Excel Discussion (Misc queries) | |||
macro to copy cells to intermittent rows in a spreadsheet | Excel Discussion (Misc queries) | |||
Macro to copy cells to rows below | Excel Discussion (Misc queries) |