I am having issues with converting text values into numeric values in Excel. I have excel sheet that has some text values and i would like to convert these text values into numbers using VBA or macro. The range that i always want to change starts from s2 to v2 columns and the number of rows are always dynamic. One day i can have 10 rows but next day i can have 20000 rows. However, i only want to run the macro when the summary sheet is activated in other words when the summary sheet is clicked i want to run the macro. please help. thanks
Sub TextToNumber()
'
' TextToNumber Macro
'
'
Dim sht As Worksheet
Dim LastRow As Long
Dim LastColumn As Long
Dim StartCell As Range
Set sht = Worksheets("Detail")
Range("AJ1").Select
Selection.Copy
Set StartCell = Range("S2:Y9")
'Find Last Row and Column
LastRow = sht.Cells(sht.Rows.Count, StartCell.Column).End(xlUp).Row
LastColumn = sht.Cells(StartCell.Row, sht.Columns.Count).End(xlToLeft).Column
'Select Range
sht.Range(StartCell, sht.Cells(LastRow, LastColumn)).Select
Selection.PasteSpecial Paste:=xlPasteAll, Operation:=xlMultiply, _
SkipBlanks:=False, Transpose:=False
Sheets("Summary").Select
End Sub