Thread: Data moving 2
View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
climate climate is offline
external usenet poster
 
Posts: 91
Default Data moving 2

Hi tom
Thank you
I tested your code, first problem (run time error)is solved, but desired
range dosen't cut, and overlap to prior data. i need to move desired range
and paste to new position based on row number in Box.

"tompl" wrote:

Woops, I forgot to change cut back to copy. Use this:

Sub climate2()

Dim xLng As Long, yLng As Long
xLng = Range("X" & Rows.Count).End(xlUp).Row
yLng = InputBox("enter the row number to paste")
Range("A2:BK" & xLng).Copy 'or Cut (Can't PasteSpecial Cut cells)
Range("A" & yLng).PasteSpecial Paste:=xlPasteValues 'Or just Paste
Application.CutCopyMode = False
Range("A1").Select
MsgBox "Updated"

End Sub