ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Returning to same column on current line? (https://www.excelbanter.com/excel-programming/418296-returning-same-column-current-line.html)

[email protected]

Returning to same column on current line?
 
Hi guys and girls,

I am trying to return to a specific cell, in a specific column where I
am on a specific row?

i.e. I am in N21, and need to return to G22?

I konw there is an easy answer to this, but I have hunted high and low
all morning...

thanks in advance.

Craig


Mike H

Returning to same column on current line?
 
Hi,

When you say return, for the most part you don't have to actually be in a
cell to do something to it or read from/to it. However, try this

Range("G22").select

Mike

" wrote:

Hi guys and girls,

I am trying to return to a specific cell, in a specific column where I
am on a specific row?

i.e. I am in N21, and need to return to G22?

I konw there is an easy answer to this, but I have hunted high and low
all morning...

thanks in advance.

Craig



brzak

Returning to same column on current line?
 
need to return what exactly?

do you want to write the formula "=N22" in G11 programatcally?

maybe a little more explanation would help, i don't understand how
these are connected:

"same column on current line"
"I am in N21, and need to return to G22"


On Oct 9, 12:09*pm, wrote:
Hi guys and girls,

I am trying to return to a specific cell, in a specific column where I
am on a specific row?

i.e. *I am in N21, and need to return to G22?

I konw there is an easy answer to this, but I have hunted high and low
all morning...

thanks in advance.

Craig



[email protected]

Returning to same column on current line?
 
Apologies all,

Didn't explain myself correctly.

I have a macro that ends in a specific cell (which could be on cell on
the same line i.e. N21) i would like to then select the corresponding
cell in column G, however, down one line? i.e. G22?

This is what I have below.

Thanks

Craig


Sub Run_Multi_Line()

'runs Macro "Bars", which ends in last cell in range, on same row.

Range("G5").Select
Do While ActiveCell.Value < "Stop"
If ActiveCell.Value = "*" Then
Bars
Else
ActiveCell.Offset(1, 0).Select <<<<< I need to change this to
select column G, down one row from current?
End If
Loop

End Sub


Mike H

Returning to same column on current line?
 
Maybe this

Sub Run_Multi_Line()

'runs Macro "Bars", which ends in last cell in range, on same row.

Range("G5").Select
Do While ActiveCell.Value < "Stop"
If ActiveCell.Value = "*" Then
Bars
Else
Range("G" & ActiveCell.Row + 1).Select

End If
Loop

End Sub

Mike

" wrote:

Apologies all,

Didn't explain myself correctly.

I have a macro that ends in a specific cell (which could be on cell on
the same line i.e. N21) i would like to then select the corresponding
cell in column G, however, down one line? i.e. G22?

This is what I have below.

Thanks

Craig


Sub Run_Multi_Line()

'runs Macro "Bars", which ends in last cell in range, on same row.

Range("G5").Select
Do While ActiveCell.Value < "Stop"
If ActiveCell.Value = "*" Then
Bars
Else
ActiveCell.Offset(1, 0).Select <<<<< I need to change this to
select column G, down one row from current?
End If
Loop

End Sub




All times are GMT +1. The time now is 01:53 AM.

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