Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I found this code snippet in Google groups and it works to do what I
need done - move contents of A2 to B1, contents of A3 to C1. But I need it to do it for some 500 or so records, and it won't go past the first one. I tried a Do While...Next loop where it should continue while r0 but that first put the data into b and c and on the next loop it took it back out!! I haven't a clue why that is happening. I then thouhgt if I deleted the now empty rows, the next addr would then be in A1, but of course, that deleted the successful move from the first round of the code. I'm at a loss how to access the rest of the addresses to get them into the new format. Could someone please help me with this - or perhaps I should use a different approach. I was thinking if I move the info into A1, B1 and C1 of a second sheet, then deleted all the empty rows so that the next addr is now at A1, I could do it that way and then just dump the empty sheet. As you can see, I am fumbling in the dark. Please help Public Sub RowsToCols() Dim r Dim I r = Range("A1").CurrentRegion.Rows.Count For I = 1 To r Step 3 Range("A1").Offset(I - 1, 1).Value = Range("A1").Offset(I, 0).Value Range("A1").Offset(I - 1, 2).Value = Range("A1").Offset(I + 1, 0).Value Range("A1").Offset(I, 0).Value = "" Range("A1").Offset(I + 1, 0).Value = "" End Sub |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Making Data and Axis Labels Different | Charts and Charting in Excel | |||
Making Box Labels on UPS Thermal Using Excel. | Excel Discussion (Misc queries) | |||
making labels 'Easy to detect' | Excel Discussion (Misc queries) | |||
Data labels: Making the value currency & use % in a chart? | Charts and Charting in Excel | |||
Making Mailing Labels | Links and Linking in Excel |