Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Using 'i' to calculate public variables

If anyone can help me out:

I've written some code that uses public variables and the values transfer
fine from one sub to the next when placed in sequence. But for some reason I
can't get a set of variables to transfer to another sub when I perform
calculations were I'm selecting the variable name with the 'i' variable.

I'm going to past in the variables declared and the sub that's not working
properly. Could a more knowledgeable person tell me what's breaking down?
Thank you.

Public Row_Constant As Integer
Public Spacer As Integer
Public Stores_Per_Graph_1 As String
Public Stores_Per_Graph_2 As String
Public Stores_Per_Graph_3 As String
Public Stores_Per_Graph_4 As String
Public Number_of_Graphs As String
Public Store_Count As Integer
Public i As Integer

Sub GET_STORES_PER_GRAPH()

Number_of_Graphs = 2
Store_Count = 29

Dim a As Integer
Dim Stores_Used As Integer

a = 0
i = 1

MsgBox ("This is " & Stores_Per_Graph_i)

Do

Stores_Per_Graph_i = Ceiling((Store_Count - Stores_Used) / (Number_of_Graphs
- a))
Stores_Used = Stores_Used + Stores_Per_Graph_i

MsgBox ("This is " & Stores_Per_Graph_i)

i = i + 1
a = a + 1
Loop Until (Number_of_Graphs - a) = 0

End Sub

Sub GET_STORES_PER_GRAPH_1 ()

MsgBox ("This is " & Stores_Per_Graph_i)

End Sub

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Using 'i' to calculate public variables

Thank you. I tried to simplify my problem by isolating the code that was
giving me problems, but after you answered I realized that I hadn't included
everything to make that code function. At any rate, thank you - that works.
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
Public variables johnny Excel Discussion (Misc queries) 2 February 24th 08 05:05 AM
Public Variables Jerry McNabb Excel Discussion (Misc queries) 0 February 24th 08 01:26 AM
Public variables Tomski[_28_] Excel Programming 3 August 10th 06 03:19 PM
Public Variables ExcelMonkey[_190_] Excel Programming 5 February 21st 05 10:12 AM
Public Variables Les Gordon Excel Programming 2 November 11th 04 12:29 PM


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