P
Patrick C. Simonds
My code below does exactly what I need it to do. My only issue is that if
it is pasting the data way down on the sheet, the user has to scroll down to
find if. Any way to have the newly pasted data display after it is pasted?
Sub Paste_Data()
Dim BCell, NBCell
Dim PasteTo As Range
Dim rng
On Error GoTo Done
Range("B5").Select
Application.ScreenUpdating = False
Application.EnableEvents = False
For i = 1 To 65536
If ActiveCell.Value = Empty Then
BCell = "B" & CStr(i - 1)
NBCell = "B" & CStr(i - 2)
GoTo Finished
Else
Range("B" & CStr(i + 1)).Select
End If
Next i
Finished:
Application.EnableEvents = True
Set rng = Cells(ActiveCell.Row, 1)
rng(1, 2).Select
Selection.PasteSpecial Paste:=xlPasteValues
Application.EnableEvents = True
Done:
End Sub
it is pasting the data way down on the sheet, the user has to scroll down to
find if. Any way to have the newly pasted data display after it is pasted?
Sub Paste_Data()
Dim BCell, NBCell
Dim PasteTo As Range
Dim rng
On Error GoTo Done
Range("B5").Select
Application.ScreenUpdating = False
Application.EnableEvents = False
For i = 1 To 65536
If ActiveCell.Value = Empty Then
BCell = "B" & CStr(i - 1)
NBCell = "B" & CStr(i - 2)
GoTo Finished
Else
Range("B" & CStr(i + 1)).Select
End If
Next i
Finished:
Application.EnableEvents = True
Set rng = Cells(ActiveCell.Row, 1)
rng(1, 2).Select
Selection.PasteSpecial Paste:=xlPasteValues
Application.EnableEvents = True
Done:
End Sub