ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Getting handle to Row # dynamically (https://www.excelbanter.com/excel-discussion-misc-queries/109483-getting-handle-row-dynamically.html)

prakash

Getting handle to Row # dynamically
 
Hello Experts,

1. I let the user select a range by foll code.

Dim Rg As Range
On Error Resume Next
Set Rg = Application.InputBox(prompt:="Select range", Type:=8)
If Rg Is Nothing Then
MsgBox "Operation Cancelled"
Else
Rg.Select
End If
2. User selects a row, for example say Row 10.
3. I want to perform a calculation on ColumnG and ColumnH of Row 10
(starting from row # 10 till end of value in columns G and H)
4. How will I get handle to column G and column H of Row 10.

Thanks in advance

Regards

Toppers

Getting handle to Row # dynamically
 
startrow=Rg.row
lastrow=Cells(rows.count,"G").end(xlup).row

HTH

"Prakash" wrote:

Hello Experts,

1. I let the user select a range by foll code.

Dim Rg As Range
On Error Resume Next
Set Rg = Application.InputBox(prompt:="Select range", Type:=8)
If Rg Is Nothing Then
MsgBox "Operation Cancelled"
Else
Rg.Select
End If
2. User selects a row, for example say Row 10.
3. I want to perform a calculation on ColumnG and ColumnH of Row 10
(starting from row # 10 till end of value in columns G and H)
4. How will I get handle to column G and column H of Row 10.

Thanks in advance

Regards



All times are GMT +1. The time now is 12:06 AM.

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