Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Call a Private Sub using a variable

The routine below does not operate as intended, as the Call method
does not recognize a variable.
Call Supported_Reports(i) does not work.

How can I change this routine to male it work?

Thanks!

Sub Format_Reports()

Dim Supported_Reports(1) As String
Dim i As Integer

Supported_Reports(0) = "CGE457"
Supported_Reports(1) = "SPE962"

For i = 0 To i = UBound(Supported_Reports)
If Not ActiveSheet.Cells.Find(Supported_Reports(i)) Is Nothing
Then Call Supported_Reports(i)
Next i

End Sub
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 421
Default Call a Private Sub using a variable

Hi Caezar,

Try using the Run method which
takes a string argument.

So replace

Then Call Supported_Reports(i)


with

Then Application.Run Call Supported_Reports(i)

See VBA help for more information
on the Run method


---
Regards.
Norman
"Caezar" wrote in message
...
The routine below does not operate as intended, as the Call method
does not recognize a variable.
Call Supported_Reports(i) does not work.

How can I change this routine to male it work?

Thanks!

Sub Format_Reports()

Dim Supported_Reports(1) As String
Dim i As Integer

Supported_Reports(0) = "CGE457"
Supported_Reports(1) = "SPE962"

For i = 0 To i = UBound(Supported_Reports)
If Not ActiveSheet.Cells.Find(Supported_Reports(i)) Is Nothing
Then Call Supported_Reports(i)
Next i

End Sub


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Call a Private Sub using a variable

On May 4, 8:31 pm, "Norman Jones"
wrote:
Hi Caezar,

Try using the Run method which
takes a string argument.

So replace

Then Call Supported_Reports(i)


with

Then Application.Run Call Supported_Reports(i)

See VBA help for more information
on the Run method

---
Regards.
Norman"Caezar" wrote in message

...

The routine below does not operate as intended, as the Call method
does not recognize a variable.
Call Supported_Reports(i) does not work.


How can I change this routine to male it work?


Thanks!


Sub Format_Reports()


Dim Supported_Reports(1) As String
Dim i As Integer


Supported_Reports(0) = "CGE457"
Supported_Reports(1) = "SPE962"


For i = 0 To i = UBound(Supported_Reports)
If Not ActiveSheet.Cells.Find(Supported_Reports(i)) Is Nothing
Then Call Supported_Reports(i)
Next i


End Sub


Ha, thanks!
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 15
Default Call a Private Sub using a variable

Hello
Supported_Reports is :
1. a variable in line Dim Supported_Reports(1) As String
2. a procedure in line Then Call Supported_Reports(i)

Rename first or second

J a c q u e s

"Caezar" a écrit dans le message de
...
The routine below does not operate as intended, as the Call method
does not recognize a variable.
Call Supported_Reports(i) does not work.

How can I change this routine to male it work?

Thanks!

Sub Format_Reports()

Dim Supported_Reports(1) As String
Dim i As Integer

Supported_Reports(0) = "CGE457"
Supported_Reports(1) = "SPE962"

For i = 0 To i = UBound(Supported_Reports)
If Not ActiveSheet.Cells.Find(Supported_Reports(i)) Is Nothing
Then Call Supported_Reports(i)
Next i

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
How to call a private sub() in another module J@Y Excel Programming 4 July 13th 07 08:08 PM
IF Statements-call private sub CrimsonPlague29 Excel Worksheet Functions 0 May 11th 06 04:54 PM
private variable: same module, other Sub/Function Stefi Excel Programming 4 July 5th 05 09:10 AM
Initialize a Private variable jerry chapman[_2_] Excel Programming 5 February 21st 05 11:41 PM
Call Private Function from ThisWorkbook module Beto[_3_] Excel Programming 3 February 25th 04 01:36 PM


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