ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Range Offset (https://www.excelbanter.com/excel-programming/376410-range-offset.html)

jsd219

Range Offset
 
Hi all, can anyone help me with this line:

cell.Offset(1, .Range "G").Value = "x"

I am trying to offset a row to a specific column

this is what the original line read:

cell.Offset(1, -5).Value = "x"

I was hoping to use a range letter instead of a number.

God bless
jsd219


Randy Harmelink

Range Offset
 
I'm not exactly sure what you mean by "range letter"? If you mean
column G of the worksheet, you could do something like:

Cells(cell.Row, Range("G:G").Column).Value = "x"

On Oct 31, 8:29 pm, "jsd219" wrote:
Hi all, can anyone help me with this line:

cell.Offset(1, .Range "G").Value = "x"

I am trying to offset a row to a specific column

this is what the original line read:

cell.Offset(1, -5).Value = "x"

I was hoping to use a range letter instead of a number.



jsd219

Range Offset
 
But i need it to be one row below as well. :-)

God bless
jsd219



Randy Harmelink wrote:
I'm not exactly sure what you mean by "range letter"? If you mean
column G of the worksheet, you could do something like:

Cells(cell.Row, Range("G:G").Column).Value = "x"

On Oct 31, 8:29 pm, "jsd219" wrote:
Hi all, can anyone help me with this line:

cell.Offset(1, .Range "G").Value = "x"

I am trying to offset a row to a specific column

this is what the original line read:

cell.Offset(1, -5).Value = "x"

I was hoping to use a range letter instead of a number.



Randy Harmelink

Range Offset
 
OK, how about:

Cells(cell.Row + 1, Range("G:G").Column).Value = "x"

On Oct 31, 10:34 pm, "jsd219" wrote:
But i need it to be one row below as well. :-)



jsd219

Range Offset
 
Awesome, Thank you very much

God bless
jsd219

PS. I knew it had to be something simple. :-)



Randy Harmelink wrote:
OK, how about:

Cells(cell.Row + 1, Range("G:G").Column).Value = "x"

On Oct 31, 10:34 pm, "jsd219" wrote:
But i need it to be one row below as well. :-)




All times are GMT +1. The time now is 02:17 PM.

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