ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Excel Visual Basic to get current row number (https://www.excelbanter.com/excel-discussion-misc-queries/449079-excel-visual-basic-get-current-row-number.html)

[email protected]

Excel Visual Basic to get current row number
 
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("AA" & sEndRow)
sLast_Name = ActiveSheet.Range("AA" & sEndRow)
sFull_Name = sFirst_Name & " " & sLast_Name

End Sub


GS[_2_]

Excel Visual Basic to get current row number
 
Already answered in the other forum you posted to.

In future, please do not multi-post; cross-post instead so answers in
any forum also display in all forums posted to.

--
Garry

Free usenet access at http://www.eternal-september.org
Classic VB Users Regroup!
comp.lang.basic.visual.misc
microsoft.public.vb.general.discussion




All times are GMT +1. The time now is 08:32 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com