Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 224
  • Last Modified:

Active Cell.Row value

Anyone know how to collect the row number of an active cell? I have been trying to use "set n = ActiveCell.Row" but that does not seem to work. I am trying to set the "n" as a variable to be used elsewhere in the event.
0
pwanveer
Asked:
pwanveer
  • 2
1 Solution
 
Harisha M GCommented:
Hi, remove "Set"

---
Harish
0
 
Harisha M GCommented:
n = ActiveCell.Row


NOTE: Set is used to assign the objects. Since Row returns a Long, which is not an object, you should not use Set
0
 
tushar_compCommented:
run teh following sub
u will get it..


Sub test2()
 
   Dim i As Integer
   i = ActiveCell.Row

End Sub


Tushar
0
 
pwanveerAuthor Commented:
That's got it. Thank you!
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now