View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
funkymonkUK[_91_] funkymonkUK[_91_] is offline
external usenet poster
 
Posts: 1
Default questions about Dim


Hi

I want to make the lastrow of sheet1 column A common knowledge between
my macros. Reason being is i want to refer the the lastrow a lot of
times

I thought maybe public sub would help this is my code

Public figs
' Count Rows in table
Dim lastRowpub As Long
lastRowpub = Worksheets("Sheet1").Cells(Rows.Count,
"A").End(xlUp).Row


It keeps coming up saying

Compile Error: Invalid Outside Procedure

and then highlights the (xlUp) part of the line


any ideas?


--
funkymonkUK
------------------------------------------------------------------------
funkymonkUK's Profile: http://www.excelforum.com/member.php...o&userid=18135
View this thread: http://www.excelforum.com/showthread...hreadid=516165