View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Gary Brown Gary Brown is offline
external usenet poster
 
Posts: 178
Default runtime Error '424' using Application.Selection

Without having tested it, I would say, try...
bpDisplayLocationRE.Text = "'" & selRange.Parent.Name & "'!" &
selRange.Address
instead of...
bpDisplayLocationRE.Text = "'" & selRange.Worksheet.Name & "'!" &
selRange.Address

--
HTH,
Gary Brown

If this post was helpful to you, please select ''YES'' at the bottom of the
post.



"malpropio" wrote:

Hi everyone,
I have that piece of code to set the focus of a userform to a certain
sheet and cell but problem is I keep on getting a runtime error '424'

Dim selRange As Range
Set selRange = Application.Selection
'ecDisplayLocationRE.Text = "'" & selRange.Worksheet.Name & "'!" &
selRange.Address
bpDisplayLocationRE.Text = "'" & selRange.Worksheet.Name & "'!" &
selRange.Address
'ecDisplayLocation.SetFocus
bpDisplayLocation.SetFocus


Thks for the help