Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
How do I return the location (as a range) of ActiveCell? | Excel Discussion (Misc queries) | |||
lookup single value in one sheet, return multiple results from theother sheet | Excel Worksheet Functions | |||
If activecell.column = variable then activecell,offset (0,1) | Excel Discussion (Misc queries) | |||
Return number of current sheet | Excel Worksheet Functions | |||
ActiveCell to top left cell of a sheet | Excel Programming |