Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 204
Default Get value at end of a row

I am trying to pull the last value in a row and am using the code

lastlap = Sheets("B Grade").Range("H" & riderCell.Row).End(xlRight)

I am determining the starting position of the row with the constant
ridercell. (eg the value I need is to the right of h2 or h100 depending on
the value of ridercell). The worksheet "b grade" is not always the active
sheet if this makes a difference to the code.

Thanks
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 8,520
Default Get value at end of a row

Try

Dim lngCol as Long
lngCol = Sheets("B Grade").Cells(Ridercell.Row,
Columns.Count).End(xlToLeft).Column
Msgbox cells(Ridercell.Row,lngCol)

If this post helps click Yes
---------------
Jacob Skaria


"NDBC" wrote:

I am trying to pull the last value in a row and am using the code

lastlap = Sheets("B Grade").Range("H" & riderCell.Row).End(xlRight)

I am determining the starting position of the row with the constant
ridercell. (eg the value I need is to the right of h2 or h100 depending on
the value of ridercell). The worksheet "b grade" is not always the active
sheet if this makes a difference to the code.

Thanks

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2,494
Default Get value at end of a row


not sure exactly what you want.

Sub test()
Dim ridercell As Range
Dim lastcol As Long
Dim lastlap As String
With Sheets("b grade")
Set ridercell = .Range("A26")
lastcol = .Cells(ridercell.Row,
Columns.Count).End(xlToLeft).Column
lastlap = .Cells(ridercell.Row, lastcol).Address
MsgBox lastlap
End With
End Sub

--

Gary Keramidas
Excel 2003


"NDBC" wrote in message
...
I am trying to pull the last value in a row and am using the code

lastlap = Sheets("B Grade").Range("H" & riderCell.Row).End(xlRight)

I am determining the starting position of the row with the constant
ridercell. (eg the value I need is to the right of h2 or h100 depending on
the value of ridercell). The worksheet "b grade" is not always the active
sheet if this makes a difference to the code.

Thanks


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 10:44 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"