I get errors while running this code (despite the fact that the type of the selection indeed is Range). Why?
[VBA]
' the type is Range
MsgBox TypeName(Selection)
Dim sel As Range
' here i get an error
sel = Selection
[/VBA]
I get errors while running this code (despite the fact that the type of the selection indeed is Range). Why?
[VBA]
' the type is Range
MsgBox TypeName(Selection)
Dim sel As Range
' here i get an error
sel = Selection
[/VBA]
Hi Chamster,
You need to use the 'Set' keyword for an object, eg a Range
Set sel = Selection
Cheers,
dr
"Questions, help and advice for free, small projects by donation. large projects by quote"
http:\\www.ExcelVBA.joellerabu.com