Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
Ren Ren is offline
external usenet poster
 
Posts: 67
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 703
Default 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
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
Macro security level in excel will not change Randy Excel Discussion (Misc queries) 0 January 12th 06 11:06 PM
Macro security level in excel will not change Randy Setting up and Configuration of Excel 0 January 12th 06 11:06 PM
How to change Macro security level very high to low... areddy[_19_] Excel Programming 1 November 3rd 05 10:37 AM
Using VBA to change macro security level Tracey[_4_] Excel Programming 4 January 23rd 04 07:20 PM
Macro to change security level Michael Miazga[_2_] Excel Programming 2 July 21st 03 08:39 PM


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