Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 131
Default Run macro according to value of a cell

How to make a macro run automatically according to a value of a cell?

Eq: once we enter value '5' in cell G8, then a particular macro should run 5
times
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 434
Default Run macro according to value of a cell

hi, !

How to make a macro run automatically according to a value of a cell?
Eq: once we enter value '5' in cell G8, then a particular macro should run 5 times


copy/paste (or type) the following in "that" worlksheet code module
(right-click its tab/name and choose: "viwe code")

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address < "$G$8" Then Exit Sub Else Dim n As Byte
For n = 1 To Val(Range("g8"))
Macro1
Next
End Sub

hth,
hector.


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
Paste A Cell Formula Into A Cell With A Macro. Minitman Excel Worksheet Functions 0 March 26th 08 04:50 AM
macro to move part of cell contents to another cell icetoad hisself Excel Discussion (Misc queries) 4 November 27th 06 07:19 PM
using a cell value to control a counter inside a macro and displaying macro value ocset Excel Worksheet Functions 1 September 10th 06 05:32 AM
Using macro to copy a part of a cell content to next cell Charles Excel Discussion (Misc queries) 6 May 31st 06 05:57 AM
Macro for cell selection starting with Last Cell Valerie Excel Worksheet Functions 4 December 9th 05 08:25 PM


All times are GMT +1. The time now is 04:53 AM.

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"