Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Identify Current Row for ActiveCell
I am in need of a sample VB code for Excel that will allow me to identify the
current row for the ActiveCell. Once I have the active row - I will "Selection.ClearContents" the entire row. Thanks for any help you can provide. -- Regards Mark H |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Identify Current Row for ActiveCell
Why select...
ActiveCell.EntireRow.ClearContents HTH "COL H" wrote: I am in need of a sample VB code for Excel that will allow me to identify the current row for the ActiveCell. Once I have the active row - I will "Selection.ClearContents" the entire row. Thanks for any help you can provide. -- Regards Mark H |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Identify Current Row for ActiveCell
Range("a2").Select
MsgBox ActiveCell.Row Selection.EntireRow.ClearContents HTH "COL H" wrote: I am in need of a sample VB code for Excel that will allow me to identify the current row for the ActiveCell. Once I have the active row - I will "Selection.ClearContents" the entire row. Thanks for any help you can provide. -- Regards Mark H |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Identify Current Row for ActiveCell
If the current selection includes more than one row (your code is selecting a
single cell so not a problem), then your code will clear the contents of more than just the activecell row. This could be what COL H wants but it is not what was asked for... Up to COL H to decide. HTH "Toppers" wrote: Range("a2").Select MsgBox ActiveCell.Row Selection.EntireRow.ClearContents HTH "COL H" wrote: I am in need of a sample VB code for Excel that will allow me to identify the current row for the ActiveCell. Once I have the active row - I will "Selection.ClearContents" the entire row. Thanks for any help you can provide. -- Regards Mark H |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
Identify Current Row for ActiveCell
Jim,
Agreed. I used the the sample to illustrate how one could get the row number. I accept using your solution is "more" correct but one day he might one the row number ...!. "Jim Thomlinson" wrote: If the current selection includes more than one row (your code is selecting a single cell so not a problem), then your code will clear the contents of more than just the activecell row. This could be what COL H wants but it is not what was asked for... Up to COL H to decide. HTH "Toppers" wrote: Range("a2").Select MsgBox ActiveCell.Row Selection.EntireRow.ClearContents HTH "COL H" wrote: I am in need of a sample VB code for Excel that will allow me to identify the current row for the ActiveCell. Once I have the active row - I will "Selection.ClearContents" the entire row. Thanks for any help you can provide. -- Regards Mark H |
#6
Posted to microsoft.public.excel.programming
|
|||
|
|||
Identify Current Row for ActiveCell
I wouldn't say more correct. Gosh only knows if your code is what is actually
wanted or mine. I have seen your code and the distinction between the selection and the acitve cell is not lost on you. It is however a subtlety that is lost on many. It took me a while to fully appreciate it... But I can be a little slow... Between the two of us we have answered this question from all angles... :-) "Toppers" wrote: Jim, Agreed. I used the the sample to illustrate how one could get the row number. I accept using your solution is "more" correct but one day he might one the row number ...!. "Jim Thomlinson" wrote: If the current selection includes more than one row (your code is selecting a single cell so not a problem), then your code will clear the contents of more than just the activecell row. This could be what COL H wants but it is not what was asked for... Up to COL H to decide. HTH "Toppers" wrote: Range("a2").Select MsgBox ActiveCell.Row Selection.EntireRow.ClearContents HTH "COL H" wrote: I am in need of a sample VB code for Excel that will allow me to identify the current row for the ActiveCell. Once I have the active row - I will "Selection.ClearContents" the entire row. Thanks for any help you can provide. -- Regards Mark H |
#7
Posted to microsoft.public.excel.programming
|
|||
|
|||
Identify Current Row for ActiveCell
May I ask why the ActiveCell row? I wonder if you could explain your
process; I'll wager to bet we could come up with a better/efficient solution to fit your needs. -- Regards, Zack Barresse, aka firefytr "COL H" wrote in message ... I am in need of a sample VB code for Excel that will allow me to identify the current row for the ActiveCell. Once I have the active row - I will "Selection.ClearContents" the entire row. Thanks for any help you can provide. -- Regards Mark H |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Identify the Current Cell | Excel Discussion (Misc queries) | |||
Identify current active cell | Excel Worksheet Functions | |||
identify the name of the activecell not its address | Excel Programming | |||
Referencing "current" row (not using ActiveCell.Row) | Excel Programming | |||
How do I reference Current Cell when cell isn't the Activecell | Excel Programming |