View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
malpropio malpropio is offline
external usenet poster
 
Posts: 7
Default runtime Error '424' using Application.Selection

No bpDisplayLocationRE is a RefEdit not a TextBox.



On Mar 19, 4:28 pm, Gary Brown
wrote:
I'm assuming 'bpDisplayLocationRE' is a text box.
What is 'bpDisplayLocation'?

--
HTH,
Gary Brown

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

"malpropio" wrote:
Same result, still getting th Runtime Error.


On Mar 19, 2:26 pm, Gary Brown
wrote:
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