+ Reply to Thread
Results 1 to 3 of 3

Return Activecell row number from another sheet

  1. #1
    quartz
    Guest

    Return Activecell row number from another sheet

    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.

  2. #2
    Jim Thomlinson
    Guest

    RE: Return Activecell row number from another sheet

    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

    "quartz" wrote:

    > 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.


  3. #3
    quartz
    Guest

    RE: Return Activecell row number from another sheet

    Okay, thanks much Jim.

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

    "Jim Thomlinson" wrote:

    > 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
    >
    > "quartz" wrote:
    >
    > > 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.


+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1