Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Pause recorded macro for user selection of menu option

I have a macro that creates a series of validation lists. Since I need to
create about 100 forms with 10 to 20 validation list each. I would really
like my macro to do more. I create a series of range names, then I need to
use them in my validation lists. My macro selects "Data", "Validation",
"List", places an "=" in the box, then selects "Insert", "Name", "Paste".
Then I need to select the appropriate name from the list of range names, but
I don't know how to modify the macro to allow for this selection. I have
searched my books and cannot find an answer. I have started to study VBA but
I need this this week if possible and I'm not ready to write the code. I
would really appreciate some help. Thanks
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,058
Default Pause recorded macro for user selection of menu option

Here is an exaple that you may be able to adapt. Say we have a macro that at
some point needs the users to supply data in A1 and B1 and C1.

We want the macro to tell the user to puts values in A1, B1, and C1 and then
wait until all three cells are filled.

Once all three cells are filled, the macro should proceed.

Sub WaitForEntry()
MsgBox ("Please fill A1, B1, and C1")
Set r = Range("A1:C1")
While Application.WorksheetFunction.Count(r) < 3
DoEvents
Wend
MsgBox ("Thank you")
End Sub

The DoEvents allows the user and the macro to share focus.
--
Gary''s Student - gsnu200832


"Steve Gibbs" wrote:

I have a macro that creates a series of validation lists. Since I need to
create about 100 forms with 10 to 20 validation list each. I would really
like my macro to do more. I create a series of range names, then I need to
use them in my validation lists. My macro selects "Data", "Validation",
"List", places an "=" in the box, then selects "Insert", "Name", "Paste".
Then I need to select the appropriate name from the list of range names, but
I don't know how to modify the macro to allow for this selection. I have
searched my books and cannot find an answer. I have started to study VBA but
I need this this week if possible and I'm not ready to write the code. I
would really appreciate some help. Thanks

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,939
Default Pause recorded macro for user selection of menu option

And what happens if A1, B1 and C1 are never filled (with numbers since you
are using count and not counta). Then the code just runs forever. I
personally would avoid code like this but to each his own.

Steve:
Here is how you create named ranges and validation lists to refer to those
ranges...

Sub test()
ThisWorkbook.Names.Add "MyList", Sheets("Sheet1").Range("A1:A3")
Sheets("Sheet1").Range("B1").Validation.Add Type:=xlValidateList, _
Formula1:="=MyList"
End Sub

--
HTH...

Jim Thomlinson


"Gary''s Student" wrote:

Here is an exaple that you may be able to adapt. Say we have a macro that at
some point needs the users to supply data in A1 and B1 and C1.

We want the macro to tell the user to puts values in A1, B1, and C1 and then
wait until all three cells are filled.

Once all three cells are filled, the macro should proceed.

Sub WaitForEntry()
MsgBox ("Please fill A1, B1, and C1")
Set r = Range("A1:C1")
While Application.WorksheetFunction.Count(r) < 3
DoEvents
Wend
MsgBox ("Thank you")
End Sub

The DoEvents allows the user and the macro to share focus.
--
Gary''s Student - gsnu200832


"Steve Gibbs" wrote:

I have a macro that creates a series of validation lists. Since I need to
create about 100 forms with 10 to 20 validation list each. I would really
like my macro to do more. I create a series of range names, then I need to
use them in my validation lists. My macro selects "Data", "Validation",
"List", places an "=" in the box, then selects "Insert", "Name", "Paste".
Then I need to select the appropriate name from the list of range names, but
I don't know how to modify the macro to allow for this selection. I have
searched my books and cannot find an answer. I have started to study VBA but
I need this this week if possible and I'm not ready to write the code. I
would really appreciate some help. Thanks

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,058
Default Pause recorded macro for user selection of menu option

I fully agree with you.

Some kind of userform is the most practical approach.
--
Gary''s Student - gsnu200832


"Jim Thomlinson" wrote:

And what happens if A1, B1 and C1 are never filled (with numbers since you
are using count and not counta). Then the code just runs forever. I
personally would avoid code like this but to each his own.

Steve:
Here is how you create named ranges and validation lists to refer to those
ranges...

Sub test()
ThisWorkbook.Names.Add "MyList", Sheets("Sheet1").Range("A1:A3")
Sheets("Sheet1").Range("B1").Validation.Add Type:=xlValidateList, _
Formula1:="=MyList"
End Sub

--
HTH...

Jim Thomlinson


"Gary''s Student" wrote:

Here is an exaple that you may be able to adapt. Say we have a macro that at
some point needs the users to supply data in A1 and B1 and C1.

We want the macro to tell the user to puts values in A1, B1, and C1 and then
wait until all three cells are filled.

Once all three cells are filled, the macro should proceed.

Sub WaitForEntry()
MsgBox ("Please fill A1, B1, and C1")
Set r = Range("A1:C1")
While Application.WorksheetFunction.Count(r) < 3
DoEvents
Wend
MsgBox ("Thank you")
End Sub

The DoEvents allows the user and the macro to share focus.
--
Gary''s Student - gsnu200832


"Steve Gibbs" wrote:

I have a macro that creates a series of validation lists. Since I need to
create about 100 forms with 10 to 20 validation list each. I would really
like my macro to do more. I create a series of range names, then I need to
use them in my validation lists. My macro selects "Data", "Validation",
"List", places an "=" in the box, then selects "Insert", "Name", "Paste".
Then I need to select the appropriate name from the list of range names, but
I don't know how to modify the macro to allow for this selection. I have
searched my books and cannot find an answer. I have started to study VBA but
I need this this week if possible and I'm not ready to write the code. I
would really appreciate some help. Thanks

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Accessing the PERSONAL.XLS without a macro ever recorded by user. cmarion Excel Programming 3 June 6th 08 04:21 PM
Pause a macro for user input RBLampert Excel Programming 15 November 23rd 07 05:30 AM
Pause macro user selection, then resume Linda Excel Programming 2 October 21st 05 05:03 PM
set up a pause in a print macro for user input Scott53 Excel Programming 1 September 7th 05 04:46 PM
Macro to pause for user input in dialog box kayabob Excel Discussion (Misc queries) 1 June 22nd 05 07:49 PM


All times are GMT +1. The time now is 08:10 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"