Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Dim lCurrentRow As Long 'never Integer
lCurrentRow = ActiveCell.Row -- Garry Free usenet access at http://www.eternal-september.org Classic VB Users Regroup! comp.lang.basic.visual.misc microsoft.public.vb.general.discussion |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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? 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 |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Set sRange = ActiveCell
sEndRow = sRange.Row Good answer! I just couldn't address the poor variable naming convention, though!<g -- Garry Free usenet access at http://www.eternal-september.org Classic VB Users Regroup! comp.lang.basic.visual.misc microsoft.public.vb.general.discussion |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Awesome thanks to the both of you!
|
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
How do you capture the name of the current worksheet in VBA? | Excel Programming | |||
Excel screen capture to capture cells and row and column headings | Excel Discussion (Misc queries) | |||
In a range of months can I capture the most current month entry? | Excel Discussion (Misc queries) | |||
Capture current WS Name? | Excel Programming | |||
Capture Current Selection in a Combo Box | Excel Programming |