Fernando14
New Member
- Joined
- Jun 29, 2021
- Messages
- 12
- Office Version
- 2019
- Platform
- Windows
I am trying to store values from one macro into another. Here is the macron that obtains the values:
I have tried using the Call command in my second macro but I get errors. I have read about using public variables, but I am not sure how they work. So in my second macro (Sub GetFlags()), how would I reference FLAGSW and FLAGSL? Any help is appreciated
VBA Code:
Sub Flags()
'
' Flags Macro
'
Dim FLAGNUM, i As Integer
FLAGNUM = InputBox("How many flags are there?")
ReDim FLAGSW(FLAGNUM), FLAGSL(FLAGNUM) As Double
ReDim FLAGSNORP(FLAGNUM) As String
For i = 1 To FLAGNUM
FLAGSW(i) = InputBox("What is flag " & i & "'s width?")
FLAGSL(i) = InputBox("What is flag " & i & "'s length?")
FLAGSNORP(i) = InputBox("Is flag " & i & " nylon or polyester? (Enter N or P)")
Next i
'
End Sub
I have tried using the Call command in my second macro but I get errors. I have read about using public variables, but I am not sure how they work. So in my second macro (Sub GetFlags()), how would I reference FLAGSW and FLAGSL? Any help is appreciated