Home |
Search |
Today's Posts |
|
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Macro to change macro or module level const that is calculated
Is it possible to use a macro to change another macro.
I have two Module level constant that i use Const numCol As Integer = 19 Const numWS As Integer = 3 Ideally, these number can change automatically. It won't work if i delcare a const with something such as Const numWS As Integer = Application.WorksheetFunction.CountA(Worksheets("S heet1").Range("G:G")) How can I make this work? I am thinking that maybe calling a macro in another module can change this. Steven |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Macro to change macro or module level const that is calculated
On 28 Nov., 19:59, Ren wrote:
Is it possible to use a macro to change another macro. I have two Module level constant that i use Const numCol As Integer = 19 Const numWS As Integer = 3 Ideally, these number can change automatically. It won't work if i delcare a const with something such as Const numWS As Integer = Application.WorksheetFunction.CountA(Worksheets("S heet1").Range("G:G")) How can I make this work? I am thinking that maybe calling a macro in another module can change this. Steven Hi Steven You can not change a constant, so you have to declare a variable. I donīt know what you want to achive, but maybe you can use an event. Dim numCol as Integer Private Sub Worksheet_Change(ByVal Target As Range) numCol = Application.WorksheetFunction.CountA(Worksheets("S heet1").Range("G:G")) 'Rest of the code End Sub Regards, Per |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Macro security level in excel will not change | Excel Discussion (Misc queries) | |||
Macro security level in excel will not change | Setting up and Configuration of Excel | |||
How to change Macro security level very high to low... | Excel Programming | |||
Using VBA to change macro security level | Excel Programming | |||
Macro to change security level | Excel Programming |