Dangerm0use
New Member
- Joined
- Mar 26, 2014
- Messages
- 6
Hi, I need a little help if possible
I am trying to retrieve a calculated variable from withinanother module, and use globally until the session of excel is closed.
I need to pass a 1 or 0 back
SubProductLookupBVC(ByVal control As IRibbonControl)
Dim Common AsNew cCommon
Dim InputCellAs Range
Dim Product AscProduct
Dim h As Long,hdrs As Variant
Dim SelRange AsRange
Dim Score AsLong
Dim LastRow AsLong
Dim Answer AsString
Dim MyNote AsString
Do something
Call CheckFlag ‘ This is the module I want the valuecalculated within see below
If Flag = 1 Then
Do something
Else
Do something else
End if
End Sub
Public Function CheckFlag(Flag As Integer) As Variant
Dim Flag As Integer
Dim MyNote As String
Dim Answer As String
Flag = 0
'Place yourtext here
MyNote ="Do you want to include headers?"
'DisplayMessageBox
Answer =MsgBox(MyNote, vbQuestion + vbYesNo, "???")
If Answer =vbNo Then
Flag = 0
Else
Flag = 1
End If
End Function
Thank you
I am trying to retrieve a calculated variable from withinanother module, and use globally until the session of excel is closed.
I need to pass a 1 or 0 back
SubProductLookupBVC(ByVal control As IRibbonControl)
Dim Common AsNew cCommon
Dim InputCellAs Range
Dim Product AscProduct
Dim h As Long,hdrs As Variant
Dim SelRange AsRange
Dim Score AsLong
Dim LastRow AsLong
Dim Answer AsString
Dim MyNote AsString
Do something
Call CheckFlag ‘ This is the module I want the valuecalculated within see below
If Flag = 1 Then
Do something
Else
Do something else
End if
End Sub
Public Function CheckFlag(Flag As Integer) As Variant
Dim Flag As Integer
Dim MyNote As String
Dim Answer As String
Flag = 0
'Place yourtext here
MyNote ="Do you want to include headers?"
'DisplayMessageBox
Answer =MsgBox(MyNote, vbQuestion + vbYesNo, "???")
If Answer =vbNo Then
Flag = 0
Else
Flag = 1
End If
End Function
Thank you
Last edited: