Return Activecell row number from another sheet

G

Guest

I'm sure I know how to do this but for some reason I'm blanking...

The program is currently working in SheetB. I want to return the row number
for the ActiveCell in SheetA (without having to activate it). SheetA is in
the same open workbook, is visible, is NOT protected. I then need to
determine if the cell in column 5 for that row number on SheetA is blank.

Can someone please help me out in remembering how to do this?

Thanks in advance.
 
G

Guest

I am affraid you have to select the other sheet in order to access the
activecell on that sheet (To the best of my knowledge). Here is some code for
you. It is a function that returns whether the E column is empty or not. The
active cell is just like it says the active cell. If the sheet is not active
then the cell is not active... This function returns you to the original
sheet where you started from...

Private Function BlankActive() As Boolean
Dim wksFrom As Worksheet
Dim wksToCheck As Worksheet
Dim blnReturnValue As Boolean

Application.ScreenUpdating = False
Set wksFrom = ActiveSheet
Set wksToCheck = Sheets("Sheet3")

wksToCheck.Select
If Intersect(ActiveCell.EntireRow,
wksToCheck.Range("E1").EntireColumn).Value <> Empty Then
blnReturnValue = False
Else
blnReturnValue = True
End If
wksFrom.Select
BlankActive = blnReturnValue
Application.ScreenUpdating = True
End Function
 
G

Guest

Okay, thanks much Jim.

I could have sworn there was a way to do this, but I guess not. Thanks for
your solution.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top