Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
Return actual range not cell value in variable
Hi, forgive my poor coding, as I haven't learnt VBA at all. How do I
ger rowendrange and nowrow to return the cell range instead of the cell value? Dim rowend As String Dim rowendrange As Range Dim nowrow As Range Dim lastrow As Range If Me.TextBox1.Value = "" Then rowend = 0 Else rowend = Me.TextBox1.Value End If rowendrange = ActiveCell.Offset(rowend, 0).Range nowrow = ActiveCell.Offset(0, -2).Range Me.TextBox2.Value = nowrow Me.TextBox3.Value=rowendrange Thanks in advance Rich |
#2
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
Return actual range not cell value in variable
I think when you are saying "range" you actually mean "address". In which
case, change the two lines to: rowendrange = ActiveCell.Offset(rowend, 0).Address nowrow = ActiveCell.Offset(0, -2).Address -- Best Regards, Luke M *Remember to click "yes" if this post helped you!* "Richhall" wrote: Hi, forgive my poor coding, as I haven't learnt VBA at all. How do I ger rowendrange and nowrow to return the cell range instead of the cell value? Dim rowend As String Dim rowendrange As Range Dim nowrow As Range Dim lastrow As Range If Me.TextBox1.Value = "" Then rowend = 0 Else rowend = Me.TextBox1.Value End If rowendrange = ActiveCell.Offset(rowend, 0).Range nowrow = ActiveCell.Offset(0, -2).Range Me.TextBox2.Value = nowrow Me.TextBox3.Value=rowendrange Thanks in advance Rich |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Return a value if variable is in a range | Excel Discussion (Misc queries) | |||
Storing a range variable in a cell | Excel Discussion (Misc queries) | |||
Variable Cell Range Reference | Excel Worksheet Functions | |||
VLOOKUP variable range cell reference | Excel Worksheet Functions | |||
Finding max array value of variable cell range | Excel Discussion (Misc queries) |