hello,
I having a problem with my Macro under the function().
First a user will enter a value(month1).
Then i declare the value as: monthsum = month1 & " total"
Then the value(monthsum) will bring into the function() but the monthsum is read as empty.
Can i able to bring the Value(monthsum) in the function()??
How can i type my code to enable it?
Thank YOU.....
CODE:
Sub Macro1()
month1 = InputBox("Enter NEW QUARTER(3 MONTH), EXAMPLE: Oct", "Current Month")
If month1 = "Jan" Then
pmonth = "Dec"
End If
If month1 = "Feb" Then
pmonth = "Jan"
End If
''''*SOME CODE HERE*''''
monthsum = month1 & " total"
X = formula(monthsum)
''''*SOME CODE HERE*''''
End Sub
Function formula()
'the monthsum is empty. How come??
Cells.Find(What:=monthsum, After:=ActiveCell, LookIn:=xlFormulas, LookAt:= _
xlWhole, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:= _
False).Activate
columnsum = ActiveCell.Column
rowsum = ActiveCell.Row
''''*SOME CODE HERE*''''
End Function
Thank YOU......