Hightechtoo
New Member
- Joined
- Jul 1, 2008
- Messages
- 7
I see in Excel 2007...there is an option of using "relative references" in a macro.
Is there any way to do that in 2003?
Is there any way to do that in 2003?
Sub test()
Dim lastrow As Long, c As Long, d As Long
lastrow = -Int(-Range("A" & Rows.Count).End(xlUp).Row / 7) * 7
For c = 1 To lastrow Step 7
d = d + 1
Range("A" & c).Resize(7).Copy
Range("B" & d).PasteSpecial Transpose:=True
Next
Application.CutCopyMode = False
End Sub
Excel Workbook | |||
---|---|---|---|
A | |||
1 | name | ||
2 | title | ||
3 | |||
4 | address | ||
5 | address | ||
6 | address | ||
7 | |||
8 | name2 | ||
9 | title2 | ||
10 | |||
11 | address2 | ||
12 | address3 | ||
13 | name | ||
14 | |||
15 | |||
16 | title | ||
17 | |||
18 | address | ||
19 | address | ||
20 | address | ||
21 | |||
Sheet |
Excel Workbook | |||||||||
---|---|---|---|---|---|---|---|---|---|
B | C | D | E | F | G | H | |||
1 | name | title | address | address | address | ||||
2 | name2 | title2 | address2 | address3 | name | ||||
3 | title | address | address | address | |||||
Sheet |