View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
anilsolipuram[_3_] anilsolipuram[_3_] is offline
external usenet poster
 
Posts: 1
Default Help with using the SUBTOTAL formula in a macro.


you are putting static value 327, that represent the last row of dat
available.

What I have done is to identify the last row of data. I assumed that A
column does not have blank data., in your case it can any column.

so now can use determine last row and substitute last row value fo
327

here the code

Dim t As Integer
t = 0
Dim I As Integer
I = 1
While t = 0
Range("a" & I).Select
If Range("a" & I).Value = "" Then
t = 1
Else
I = I + 1
End If
Wend
MsgBox "last row:" & (I - 1

--
anilsolipura
-----------------------------------------------------------------------
anilsolipuram's Profile: http://www.excelforum.com/member.php...fo&userid=1627
View this thread: http://www.excelforum.com/showthread.php?threadid=27800