Excel VB to capture the current cells row number

M

Matt

I have an excel spreadsheet with 40 columns and 200 rows. Part of my code is below. How do I write the line sEndRow = sRange.Row to correctly get number 10, if my curosr is in cell H10?

Thanks in advance,
Matt




Sub Welcome_Note()

Dim sRange As Range
Dim sEndRow As Integer
Dim sFirst_Name As String
Dim sLast_Name As String

sEndRow = sRange.Row
sFirst_Name = ActiveSheet.Range("A" & sEndRow)
sLast_Name = ActiveSheet.Range("B" & sEndRow)
sFull_Name = sFirst_Name & " " & sLast_Name

End Sub
 
I

isabelle

hi,

Set sRange = ActiveCell
sEndRow = sRange.Row

isabelle


Le 2013-07-31 22:17, Matt a écrit :
I have an excel spreadsheet with 40 columns and 200 rows. Part of my code is below.

How do I write the line sEndRow = sRange.Row to correctly get number 10,
if my curosr is in cell H10?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top