Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 983
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,339
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 983
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,339
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 983
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 14
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Identify the Current Cell Staanley Excel Discussion (Misc queries) 5 February 13th 08 11:16 AM
Identify current active cell reades Excel Worksheet Functions 6 January 10th 06 12:48 PM
identify the name of the activecell not its address RogerTheDodgerTheDirtyOldSod Excel Programming 2 September 26th 04 09:53 PM
Referencing "current" row (not using ActiveCell.Row) Mark[_46_] Excel Programming 2 June 12th 04 02:21 PM
How do I reference Current Cell when cell isn't the Activecell VBA2VBZGuy Excel Programming 2 December 15th 03 09:27 PM


All times are GMT +1. The time now is 12:05 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"