MrExcel Message Board


Go Back   MrExcel Message Board > Question Forums > Excel Questions

Excel Questions All Excel/VBA questions - formulas, macros, pivot tables, general help, etc. Please post to this forum in English only.

Reply
 
Thread Tools Display Modes
Old Mar 30th, 2004, 10:29 AM   #1
insane_hound
 
Join Date: Mar 2004
Location: UK
Posts: 3
Default Usning Cell, Row or Column function in a macro

Hi Guys,

I need to use the function cell("row",Activecell) or row(activecell) in a macro, however neither of these functions seem to be supported by 'worksheetfunction' in visual basic? Is there away to return the row number of a cell in VB?

Thanks

Regards
insane_hound is offline   Reply With Quote
Old Mar 30th, 2004, 10:50 AM   #2
Richie(UK)
MrExcel MVP
 
Richie(UK)'s Avatar
 
Join Date: May 2002
Location: UK
Posts: 3,333
Default Re: Usning Cell, Row or Column function in a macro

Hi i-h,

Just use the Row property, like this:
Code:
Sub Test()
    Dim lRow As Long
    
    lRow = ActiveCell.Row
    MsgBox "Activecell is on row : " & lRow
    
End Sub
HTH
__________________
<font color="blue"> ««« <font color="red">¤ <font color="blue"><font size=+1>Richie </font><font color="red">¤<font color="blue"> »»» </font>
Richie(UK) is offline   Reply With Quote
Old Mar 30th, 2004, 10:51 AM   #3
Jaafar Tribak
 
Jaafar Tribak's Avatar
 
Join Date: Dec 2002
Location: Larache--Morocco
Posts: 2,917
Default Re: Usning Cell, Row or Column function in a macro

Yes :

ActiveCell.Row


Regards.
__________________
Jaafar.

Happiness is when what you think, what you say, and what you do are in harmony.




http://www.laracheenelmundo.com/
Jaafar Tribak is offline   Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On

Forum Jump


All times are GMT +1. The time now is 08:02 AM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
All contents Copyright 1998-2009 by MrExcel Consulting.