Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 16
Default Goto a dynamic cell address within a macro

My workbook is formula driven and the tables will dynamically expand or
contract with the size of the data. I have a need to move to the next
available row before starting the next subroutine. I have created a formula
that computes the correct cell address but I don't know how to structure a
goto command within the macro to use it.

Can you help?

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Goto a dynamic cell address within a macro

If you know the top of the data

assume A1

Dim rng as Range
set rng = Range("A1").End(xldown).Offset(1,0)
rng.Select

or if there could be empty cells in column A

Dim rng as Range
set rng = Cells(rows.count,1).End(xlup).Offset(1,0)
rng.select
are possibilities

--
Regards,
Tom Ogilvy

"blkane" wrote in message
...
My workbook is formula driven and the tables will dynamically expand or
contract with the size of the data. I have a need to move to the next
available row before starting the next subroutine. I have created a

formula
that computes the correct cell address but I don't know how to structure a
goto command within the macro to use it.

Can you help?



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 16
Default Goto a dynamic cell address within a macro

Thanks Tom,

Unfortunately, going to the top of the range and hitting "end" "pagedown"
doesn't work. I'm copying a named range from another worksheet. The named
range contains formulas where data is visible only if a value exists. When I
copy the range to my worksheet, the cells that appeared blank are messing me
up. When I hit "end", "pagedown", it goes to the row that corresponds to the
end of the named range instead of the end of the visible data.

Hope that's not too confusing.

I created a formula that determines the cell address of where I need to
navigate. This address will always change each time the workbook is used. I
used "Application.Goto Reference:=" to go to the formula. What I need is a
command that will look at the value of the formula to obtain the cell address
and go to it.

Any other thoughts?

"Tom Ogilvy" wrote:

If you know the top of the data

assume A1

Dim rng as Range
set rng = Range("A1").End(xldown).Offset(1,0)
rng.Select

or if there could be empty cells in column A

Dim rng as Range
set rng = Cells(rows.count,1).End(xlup).Offset(1,0)
rng.select
are possibilities

--
Regards,
Tom Ogilvy

"blkane" wrote in message
...
My workbook is formula driven and the tables will dynamically expand or
contract with the size of the data. I have a need to move to the next
available row before starting the next subroutine. I have created a

formula
that computes the correct cell address but I don't know how to structure a
goto command within the macro to use it.

Can you help?




  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Goto a dynamic cell address within a macro

Terms like I create a formula and I need to look at the value of the formula
just can't be dealt with. Its like playing I'm thinking of a number.

where is the formula, what is the formula, what does it produce (an
example).

say the formula is on sheet1 in cell Z36 and it displays a string like
Sheet1!F22

Then you can do

application.Goto Reference:=Range(Worksheets("sheet1").Range("Z36") .Text)


--
Regards,
Tom Ogilvy



"blkane" wrote in message
...
Thanks Tom,

Unfortunately, going to the top of the range and hitting "end" "pagedown"
doesn't work. I'm copying a named range from another worksheet. The

named
range contains formulas where data is visible only if a value exists.

When I
copy the range to my worksheet, the cells that appeared blank are messing

me
up. When I hit "end", "pagedown", it goes to the row that corresponds to

the
end of the named range instead of the end of the visible data.

Hope that's not too confusing.

I created a formula that determines the cell address of where I need to
navigate. This address will always change each time the workbook is used.

I
used "Application.Goto Reference:=" to go to the formula. What I need is

a
command that will look at the value of the formula to obtain the cell

address
and go to it.

Any other thoughts?

"Tom Ogilvy" wrote:

If you know the top of the data

assume A1

Dim rng as Range
set rng = Range("A1").End(xldown).Offset(1,0)
rng.Select

or if there could be empty cells in column A

Dim rng as Range
set rng = Cells(rows.count,1).End(xlup).Offset(1,0)
rng.select
are possibilities

--
Regards,
Tom Ogilvy

"blkane" wrote in message
...
My workbook is formula driven and the tables will dynamically expand

or
contract with the size of the data. I have a need to move to the next
available row before starting the next subroutine. I have created a

formula
that computes the correct cell address but I don't know how to

structure a
goto command within the macro to use it.

Can you help?






  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 16
Default Goto a dynamic cell address within a macro

Tom,

Thanks. I guess I am asking it to have the "I'm thinking of a number"
intelligence.

I'll have to think of a plan b.

"Tom Ogilvy" wrote:

Terms like I create a formula and I need to look at the value of the formula
just can't be dealt with. Its like playing I'm thinking of a number.

where is the formula, what is the formula, what does it produce (an
example).

say the formula is on sheet1 in cell Z36 and it displays a string like
Sheet1!F22

Then you can do

application.Goto Reference:=Range(Worksheets("sheet1").Range("Z36") .Text)


--
Regards,
Tom Ogilvy



"blkane" wrote in message
...
Thanks Tom,

Unfortunately, going to the top of the range and hitting "end" "pagedown"
doesn't work. I'm copying a named range from another worksheet. The

named
range contains formulas where data is visible only if a value exists.

When I
copy the range to my worksheet, the cells that appeared blank are messing

me
up. When I hit "end", "pagedown", it goes to the row that corresponds to

the
end of the named range instead of the end of the visible data.

Hope that's not too confusing.

I created a formula that determines the cell address of where I need to
navigate. This address will always change each time the workbook is used.

I
used "Application.Goto Reference:=" to go to the formula. What I need is

a
command that will look at the value of the formula to obtain the cell

address
and go to it.

Any other thoughts?

"Tom Ogilvy" wrote:

If you know the top of the data

assume A1

Dim rng as Range
set rng = Range("A1").End(xldown).Offset(1,0)
rng.Select

or if there could be empty cells in column A

Dim rng as Range
set rng = Cells(rows.count,1).End(xlup).Offset(1,0)
rng.select
are possibilities

--
Regards,
Tom Ogilvy

"blkane" wrote in message
...
My workbook is formula driven and the tables will dynamically expand

or
contract with the size of the data. I have a need to move to the next
available row before starting the next subroutine. I have created a
formula
that computes the correct cell address but I don't know how to

structure a
goto command within the macro to use it.

Can you help?







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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Dynamic Assignment of a Cell Address In Formula tb Excel Worksheet Functions 9 December 14th 07 06:52 AM
Goto a specific cell in a macro Edward Excel Discussion (Misc queries) 0 July 16th 07 08:24 PM
Using Dynamic Cell Address As Formula Location [email protected] Excel Worksheet Functions 4 March 6th 07 06:37 AM
Dynamic flexible cell address dewsbury Excel Discussion (Misc queries) 2 March 9th 06 08:10 PM
Goto a dynamic cell address within a macro blkane Excel Discussion (Misc queries) 3 June 8th 05 07:08 PM


All times are GMT +1. The time now is 06:04 PM.

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

About Us

"It's about Microsoft Excel"