declaring variables


Posted by Tom lawler on July 19, 2001 12:39 PM

As an answer to inquiry about selecting all the rows that were being used in a database i was given the answer of FinalRow = Range("A9999").End(xlUp).Row.

If i use option explicit i get an error message about FinalRow needing to be declared. i'm a newbie and don't have much knowledge of declaring variables.

How would the above variable be declared?

Are there any on-line sites or books with good explainations and examples of declaring variables?

Thanks in advance.



Posted by Barrie Davidson on July 19, 2001 12:55 PM

Put
Dim FinalRow As Integer
right after your macro name. For example:

Sub YourSub()
Dim FinalRow As Integer

'the rest of the macro

End Sub

Barrie