Macro Error - Converting numbers from text to number format

hockey390

Board Regular
Joined
Jun 10, 2010
Messages
60
Hi everyone,

I created a Macro to convert numbers formatted as text to number formats. The code has worked correctly for me, but today I selected an entire column by clicking the column header and tried this, to which it populated an error: Run-Time error "424". I can't seem to get it to work anymore, even after removing the code and retyping.. I'm wondering if excel is stuck in some sort of loop now that I need to exit? I've tried pausing and doing resets through VBA, but that hasn't solved the issue. Please let me know if there is anything I can do or if I possibly have some incorrect coding here.

Here is the coding:

Sub TextToNumber()
'
' TextToNumber Macro
' Converts Text to Number Format
'
' Keyboard Shortcut: Ctrl+l
'
Cells.SpecialCells(xlCellTypeLastCell) _
.Offset(1, 1).Copy
Seleciton.PasteSpecial Paste:=xlPasteValues, _
Operation:=xlPasteSpecialOperationAdd
With Selection
.VerticalAlignment = xlTop
.WrapText = False
End With
Selection.EntireColumn.AutoFit
End Sub
 

Excel Facts

VLOOKUP to Left?
Use =VLOOKUP(A2,CHOOSE({1,2},$Z$1:$Z$99,$Y$1:$Y$99),2,False) to lookup Y values to left of Z values.
This
Seleciton.PasteSpecial Paste:=xlPasteValues
should probably be
Selection.PasteSpecial Paste:=xlPasteValues
 
Upvote 0

Forum statistics

Threads
1,207,387
Messages
6,078,197
Members
446,320
Latest member
vatra

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top