LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #7   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 268
Default Running macro x # of times with a prompt

You're right, you do not need that!

"Redskinsfan" wrote:

Kassie,
Thanks that works great now. the D52:I52 was where i had placed my cursor
after i had cut and pasted the data i needed, is where i placed my cursor and
gave the macro the lost focus signal, im not sure if that makes sense im
thinking i dont even need it.

"kassie" wrote:

Declare variables is what I wanted you to do. Remove the words Declare
variables from your module!
I don't know what you want to do with D52:I52? What happens if you just say
Range("D52:I52").Select

"Redskinsfan" wrote:

Kassie, i followed your instructions and this is what i get..im a newbie so
not sure if i should of replaced some text with something.
I get a ms visual basic compile error expected:sub or function

declare variables is red and so is range ("D52:I52")

"kassie" wrote:

Declare variables:
Dim vTimes as Variant, vCount as Variant

Sub NewContractor()
vTimes = Inputbox("How many times do you want to run this macro")
For vCount = 1 to vTimes step 1
ActiveSheet.Protect UserInterfaceOnly:=True
Rows("20:50").Copy
Rows("51:51").Insert Shift:=xlDown
Range("D52:I52"). and whatever you want to do with it
Next
End Sub

You do not have to select to act! It slows down your macros, and makes your
code a nightmare.
"Redskinsfan" wrote:

I have this macro and i want to have a prompt come up and ask how many times
the user wants to run it.. Thanks in advance

Sub New_Contractor()
'
' New_Contractor Macro
' Macro recorded 8/3/2006 by Parsons User
'

'
ActiveSheet.Protect UserInterfaceOnly:=True
Rows("20:50").Select
Selection.Copy
Rows("51:51").Select
Selection.Insert Shift:=xlDown
Application.CutCopyMode = False
Range("D52:I52").Select
ActiveWindow.SmallScroll Down:=8
End Sub

 
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
error running a paste macro Redskinsfan Excel Worksheet Functions 1 August 7th 06 08:02 PM
Problems in running a macro in another workbook dhatul Excel Discussion (Misc queries) 3 January 20th 06 08:01 AM
Macro to Prompt for File -- Neophite Needs HELP kilo1990 Excel Discussion (Misc queries) 13 December 17th 05 10:34 PM
Running a Macro automatically from Excel Brakeshoe Excel Worksheet Functions 1 July 13th 05 11:23 PM
Macro running problem Pat Excel Discussion (Misc queries) 2 May 20th 05 10:45 PM


All times are GMT +1. The time now is 02:18 AM.

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

About Us

"It's about Microsoft Excel"