PDA

View Full Version : Solved: Converting Numbers



Klartigue
02-22-2012, 08:14 AM
Ok I have the formula to convert numbers saved as text to numbers.


Sub Convert1()
' Convert text to numbers on GFI List
Range("A7").Select
ActiveCell.FormulaR1C1 = "1"
Range("A7").Select
Selection.Copy
Range("A8:A700").Select
Selection.PasteSpecial Paste:=xlPasteAll, Operation:=xlMultiply, _
SkipBlanks:=False, Transpose:=False
End Sub

How can I get this to convert the numbers only from A7 to lastrow? I know that is the code below but i need incorporate this with the above code.

LastRow = .Cells(.Rows.Count, "A").End(xlUp).Row
For i = 7 To LastRow


Thanks for the help!

Bob Phillips
02-22-2012, 08:40 AM
Sub Convert1()
Dim LastRow As Long
' Convert text to numbers on GFI List
LastRow = Cells(Rows.Count, "A").End(xlUp).Row
With Range("A7")
.Value = 1
.Copy
.Offset(1, 0).Resize(LastRow - 7).PasteSpecial Paste:=xlPasteAll, Operation:=xlMultiply
.ClearContents
End With
End Sub

Klartigue
02-22-2012, 08:44 AM
Works great, thanks again!