Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default How to get the number of a row

I am trying to draw a border line. But before dwaring a
line, I need to get the row number first. Below is the
sample code. How can I get the row number of c?

For Each c In Range("range_name")
'get the row number of c
'draw a border line
next c

Thanks.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default How to get the number of a row

Candy,

The Row property of the range will return row number of that
cell. E.g,

Dim R As Long
For Each c In Range("range_name")
R = c.Row
'draw a border line
next c


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com


"Candy" wrote in message
...
I am trying to draw a border line. But before dwaring a
line, I need to get the row number first. Below is the
sample code. How can I get the row number of c?

For Each c In Range("range_name")
'get the row number of c
'draw a border line
next c

Thanks.



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default How to get the number of a row

Hi Candy,

For Each c In Range("range_name")
iRow = c.Row
next c


--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"Candy" wrote in message
...
I am trying to draw a border line. But before dwaring a
line, I need to get the row number first. Below is the
sample code. How can I get the row number of c?

For Each c In Range("range_name")
'get the row number of c
'draw a border line
next c

Thanks.



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,236
Default How to get the number of a row

Here's an example, with border drawing.

I'm guessing, but if you're going to draw row borders then you might just
want to do:
For Each c in Range("range_name").EntireRow

Sub test()
Dim c As Range, lngRow As Long

For Each c In Range("range_name")
lngRow = c.Row
Rows(lngRow).Borders(xlEdgeBottom).Weight = xlMedium
Next c
End Sub


--
Rob van Gelder - http://www.vangelder.co.nz/excel


"Candy" wrote in message
...
I am trying to draw a border line. But before dwaring a
line, I need to get the row number first. Below is the
sample code. How can I get the row number of c?

For Each c In Range("range_name")
'get the row number of c
'draw a border line
next c

Thanks.



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
Sumif number is greater than a number but less than another number lulu151 Excel Discussion (Misc queries) 2 May 7th 10 07:12 PM
How can I click on a telephone number in an Excel 2002 spreadsheet, and have the number dialed? jbclem Excel Discussion (Misc queries) 2 August 13th 09 01:57 AM
Easy Reading - large number minus small number MUTTMIND New Users to Excel 5 February 5th 09 10:08 AM
How to calculate number of occurencies of a specific number number Stefan Excel Discussion (Misc queries) 4 September 8th 08 08:33 AM
Rounding a number to a multiple quantity that adds to a fixed total number wjlo Excel Worksheet Functions 1 November 9th 04 04:43 PM


All times are GMT +1. The time now is 12:59 PM.

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"