Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
JAD JAD is offline
external usenet poster
 
Posts: 43
Default Adding User Dialog to Macro

I have a macro that when activated will add (3) rows to a section of the
worksheet. To enhance flexibility, I would like to interrupt the macro to ask
the end user how many rows they would like to insert, set the macro to the
user number and complete the macro process. The following is the automated
macro that inserts the (3) rows automatically. Any help would be appreciated.
Thank You, JAD


Call Security_Unprotect
Application.Goto Reference:="Me02_END"
ActiveCell.Offset(0, 0).Range("a1:a3").Select
Selection.EntireRow.Insert
ActiveCell.Offset(0, 0).Range("a1").Select
ActiveWorkbook.Names.Add Name:="Me02_NEW_START", RefersToR1C1:=ActiveCell
Application.Goto Reference:="Me_COPY"
Selection.Copy
Application.Goto Reference:="Me02_NEW_START"
ActiveSheet.Paste
Application.Goto Reference:="MM_EQ_Menu_Selection"
Call Security_Protect
End Sub
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 791
Default Adding User Dialog to Macro

If you know you will always input on the top row meaning A1, then all you
need to use is the Input Function.

myNum = Application.InputBox("Enter a number")
Then susbtitute the variable MyNum in your code
--
If this posting was helpful, please click on the Yes button.
Regards,

Michael Arch.




"JAD" wrote:

I have a macro that when activated will add (3) rows to a section of the
worksheet. To enhance flexibility, I would like to interrupt the macro to ask
the end user how many rows they would like to insert, set the macro to the
user number and complete the macro process. The following is the automated
macro that inserts the (3) rows automatically. Any help would be appreciated.
Thank You, JAD


Call Security_Unprotect
Application.Goto Reference:="Me02_END"
ActiveCell.Offset(0, 0).Range("a1:a3").Select
Selection.EntireRow.Insert
ActiveCell.Offset(0, 0).Range("a1").Select
ActiveWorkbook.Names.Add Name:="Me02_NEW_START", RefersToR1C1:=ActiveCell
Application.Goto Reference:="Me_COPY"
Selection.Copy
Application.Goto Reference:="Me02_NEW_START"
ActiveSheet.Paste
Application.Goto Reference:="MM_EQ_Menu_Selection"
Call Security_Protect
End Sub

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 791
Default Adding User Dialog to Macro

You can also try something like this:
MyNum = Application.InputBox("Enter a number")
For i = 1 To MyNum
Range("A1").EntireRow.Insert
Next i
--
If this posting was helpful, please click on the Yes button.
Regards,

Michael Arch.




"JAD" wrote:

I have a macro that when activated will add (3) rows to a section of the
worksheet. To enhance flexibility, I would like to interrupt the macro to ask
the end user how many rows they would like to insert, set the macro to the
user number and complete the macro process. The following is the automated
macro that inserts the (3) rows automatically. Any help would be appreciated.
Thank You, JAD


Call Security_Unprotect
Application.Goto Reference:="Me02_END"
ActiveCell.Offset(0, 0).Range("a1:a3").Select
Selection.EntireRow.Insert
ActiveCell.Offset(0, 0).Range("a1").Select
ActiveWorkbook.Names.Add Name:="Me02_NEW_START", RefersToR1C1:=ActiveCell
Application.Goto Reference:="Me_COPY"
Selection.Copy
Application.Goto Reference:="Me02_NEW_START"
ActiveSheet.Paste
Application.Goto Reference:="MM_EQ_Menu_Selection"
Call Security_Protect
End Sub

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
User created Dialog Box SJW_OST[_2_] Excel Programming 1 June 3rd 08 08:33 AM
How do I prompt a user with a dialog box [email protected] Excel Programming 0 November 22nd 05 04:55 PM
Dialog & User Form bach New Users to Excel 2 August 13th 05 09:35 PM
Macro to pause for user input in dialog box kayabob Excel Discussion (Misc queries) 1 June 22nd 05 07:49 PM
control of dialog macro dialog box. on open Gerry Abbott Excel Programming 0 July 22nd 04 05:41 PM


All times are GMT +1. The time now is 06:41 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"