Activate Form using a macro

G

Guest

I'm trying to do something relatively simple. I want to run a small macro
that will automatically click on a cell (range name of "begin") and then
active the Form (Data -> form...). This is a work related worksheet, and my
co-workers can not remember where to activate the form.

Now, I tried doing the recorded macro, but it always fails. I have seen this
macro, but I can't seem to recreate it. What am I doing wrong??

"Sub Userform()
'
' Userform Macro
' Macro recorded 5/22/2005 by Voldemore
'

'
Range("A4").Select
ActiveSheet.ShowDataForm
End Sub"
 
T

Tom Ogilvy

the Data=>Form only looks in A1:B2 for the beginning of your data. Since
your data apparently starts in A4, it fails to find it. You can overcome
this by naming your range Database

"Sub Userform()
'
' Userform Macro
' Macro recorded 5/22/2005 by Voldemore
'

'
Range("A4").CurrentRegion.Name = "DataBase"
Range("A4").Select
ActiveSheet.ShowDataForm
End Sub

If you have data in Row 3 then you may have to use more code to determine
the exact extent of your data.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top