Patriot2879
Well-known Member
- Joined
- Feb 1, 2018
- Messages
- 1,259
- Office Version
- 2010
- Platform
- Windows
HI I have where i want Range AP2 to last column to convert to number please can you help?
Code:
Private Sub CommandButton1_Click()
Dim copySheet As Worksheet
Dim pasteSheet As Worksheet
Set copySheet = Worksheets("Jun")
Set pasteSheet = Worksheets("Jun")
Lastrow = Cells(Cells.Rows.Count, "A").End(xlUp).Row
On Error Resume Next
Range("AJ2:AJ" & Lastrow).SpecialCells(xlBlanks).Value = Range("AJ2").Value
On Error GoTo 0
Range("AP2", Range("AP2").End(xlDown)).Copy Range("A2")
Range("A2", Range("A2").End(xlDown)).NumberFormat = "0"
End Sub