Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Navigating with a macro

When navigating with a macro:
Example: Activecell.offset(1, 0).Range("A1")Select
Can I somehow have the offset numbers refer to a value in a cell
therefor making them variable based on formula input

--
Message posted from http://www.ExcelForum.com

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 194
Default Navigating with a macro

Brian - If you can put your values into Strings, you should be able to use
ActiveCell.Offset(x,y) with x and y being the Strings. So if x and y are
the values in a cell, or the calculated results of a formula, or whatever
else set in a String variable, it should work.

Ed

"Brian Matlack " wrote in
message ...
When navigating with a macro:
Example: Activecell.offset(1, 0).Range("A1")Select
Can I somehow have the offset numbers refer to a value in a cell
therefor making them variable based on formula input?


---
Message posted from http://www.ExcelForum.com/



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Navigating with a macro

Ed,

yes

Activecell.offset(Range("X1").Value, 0).Range("A1")Value)Select

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"Ed" wrote in message
...
Brian - If you can put your values into Strings, you should be able to use
ActiveCell.Offset(x,y) with x and y being the Strings. So if x and y are
the values in a cell, or the calculated results of a formula, or whatever
else set in a String variable, it should work.

Ed

"Brian Matlack " wrote in
message ...
When navigating with a macro:
Example: Activecell.offset(1, 0).Range("A1")Select
Can I somehow have the offset numbers refer to a value in a cell
therefor making them variable based on formula input?


---
Message posted from http://www.ExcelForum.com/





  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 194
Default Navigating with a macro

Activecell.offset(Range("X1").Value, 0).Range("A1")Value)Select


I know I'm not the brightest student, Bob, but I don't understand. I
created a sheet with A1=1, A2=2, A3=3, and A4=4. Then I used the following
code, and stepped through watching the Active being offset. What did I
miss?

Ed

Sub Test_Offset()

Dim a As String
Dim b As String
Dim c As String
Dim d As String

a = Range("A1").Value
b = Range("A2").Value
c = Range("A3").Value
d = Range("A4").Value

Range("D5").Activate
ActiveCell.Offset(a, b).Select
ActiveCell.Offset(c, d).Select
ActiveCell.Offset(c, b).Select
ActiveCell.Offset(a, d).Select

End Sub


  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 22,906
Default Navigating with a macro

Brian

Sample code.

Public Sub gronk()
ccols = Range("A1").Value
rrows = Range("B1").Value
ActiveCell.Resize(ccols, rrows).Select
End Sub

On Wed, 18 Feb 2004 11:08:55 -0700, "Ed"
wrote:

Brian - If you can put your values into Strings, you should be able to use
ActiveCell.Offset(x,y) with x and y being the Strings. So if x and y are
the values in a cell, or the calculated results of a formula, or whatever
else set in a String variable, it should work.

Ed

"Brian Matlack " wrote in
message ...
When navigating with a macro:
Example: Activecell.offset(1, 0).Range("A1")Select
Can I somehow have the offset numbers refer to a value in a cell
therefor making them variable based on formula input?


---
Message posted from http://www.ExcelForum.com/





  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Navigating with a macro

Thanks Gord - Works Great!

--
Message posted from http://www.ExcelForum.com

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
Navigating ~ One Fine Old Dude Excel Worksheet Functions 0 June 6th 07 06:38 PM
Navigating ~ One Fine Old Dude Excel Worksheet Functions 0 June 6th 07 06:35 PM
navigating with the tab key Cynthia[_2_] New Users to Excel 1 April 17th 07 05:18 PM
Navigating Gibbie Excel Discussion (Misc queries) 9 January 31st 05 10:49 PM
Navigating Hafeez Esmail Excel Programming 11 November 19th 03 07:18 PM


All times are GMT +1. The time now is 11:47 PM.

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

About Us

"It's about Microsoft Excel"