How do I carry a variable forward so that its value can be used in another sub routine?
I have several routines that are identical except for the column they're affecting. Just before each routine comes to an end, I assign a value to a variable (the same variable exists in all routines) and I then call another routine.
Another routine will look like this:
This value is the column number I am focusing on and fills in the missing piece of the following code:
I have several routines that are identical except for the column they're affecting. Just before each routine comes to an end, I assign a value to a variable (the same variable exists in all routines) and I then call another routine.
Code:
Dim x as Integer
x = [COLOR=#ff0000]21[/COLOR]
Call ClearAll
Another routine will look like this:
Code:
Dim x as Integer
x = [COLOR=#ff0000]25[/COLOR]
Call ClearAll
This value is the column number I am focusing on and fills in the missing piece of the following code:
Code:
Sub ClearAll()
Sheet2.Range("B10:X194").AutoFilter Field:=[COLOR=#ff0000]x[/COLOR]
End Sub