I think you can have an activesheet in every open workbook:
Option Explicit
Sub testme()
Dim wkbk As Workbook
Dim iCtr As Long
For iCtr = 1 To 3
Workbooks.Add 1
ActiveSheet.Name = "hi there" & iCtr
Next iCtr
For Each wkbk In Workbooks
With wkbk.ActiveSheet
MsgBox .Name & "--" & .Parent.Name
End With
Next wkbk
End Sub
Bob Phillips wrote:
I think it is, that should be an integer.
Also, if accessing the active workbook, VBA maintains a pointer to that, so
you don't need to go through the workbooks collection. And similarly with
the active sheet, which also can only be in the active workbook
Try
LastRow = ActiveSheet.Cells(Rows.Count,1).End(xlUp).Row
--
HTH
Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)
"ajliaks " wrote in message
...
Plz,
I am trying to use this, but getting error!
I need to get the last active row in the active sheet
Dim LastRow As Integer
LastRow =
Workbooks(ActiveWorkbook.Name).Worksheets(ActiveSh eet).Cells(Rows.Count,
"1").End(xlUp).Row
May be its because of the "1" ???
Thanks.
---
Message posted from http://www.ExcelForum.com/
--
Dave Peterson