Norm Shea
New Member
- Joined
- Jul 31, 2007
- Messages
- 19
- Office Version
- 365
- Platform
- Windows
I'm trying to write a macro and I'm having a little trouble. This is the data I have. It starts out with a reading number in B2 followed by a depth in B3, then a reading number in B4, depth in B5, etc.
Easting Northing
976 2,277,532.23 282,552.47
-1.4 2,277,529.03 282,549.27
975 2,277,530.50 282,560.28
1.2 2,277,527.30 282,557.08
974 2,277,528.33 282,570.05
2.4 2,277,525.13 282,566.84
I'd like to have it look like this where the reading from B2 is pasted in A3 and then row B is deleted entirely. I did already add the Reading and Depth columns so I just need to start on the data in B2
Reading Depth Easting Northing
976 -1.4 2,277,529.03 282,549.27
975 1.2 2,277,527.30 282,557.08
I have 1157 rows of data.
This is a macro I started but couldn't get it to work completely.
Sub ReadingsMove()
'
' ReadingsMove Macro
'
'
ActiveCell.Offset(1, 1).Range("A1").Select
Selection.Cut
ActiveCell.Offset(1, -1).Range("A1").Select
ActiveSheet.Paste
ActiveCell.Offset(-1, 0).Rows("1:1").EntireRow.Select
Selection.Delete Shift:=xlUp
End Sub
Can someone let me know what I'm missing?
Thanks,
Norm
Easting Northing
976 2,277,532.23 282,552.47
-1.4 2,277,529.03 282,549.27
975 2,277,530.50 282,560.28
1.2 2,277,527.30 282,557.08
974 2,277,528.33 282,570.05
2.4 2,277,525.13 282,566.84
I'd like to have it look like this where the reading from B2 is pasted in A3 and then row B is deleted entirely. I did already add the Reading and Depth columns so I just need to start on the data in B2
Reading Depth Easting Northing
976 -1.4 2,277,529.03 282,549.27
975 1.2 2,277,527.30 282,557.08
I have 1157 rows of data.
This is a macro I started but couldn't get it to work completely.
Sub ReadingsMove()
'
' ReadingsMove Macro
'
'
ActiveCell.Offset(1, 1).Range("A1").Select
Selection.Cut
ActiveCell.Offset(1, -1).Range("A1").Select
ActiveSheet.Paste
ActiveCell.Offset(-1, 0).Rows("1:1").EntireRow.Select
Selection.Delete Shift:=xlUp
End Sub
Can someone let me know what I'm missing?
Thanks,
Norm