Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 55
Default **URGENT** Macro to find a Cell

If I have the column row references given on 2 cells in my spreadsheet, I
need a macro to read the contents of the two cells and then select that
particular cell.

Here is the current code I have:

Sub test()

Sheets("Revised").Activate
ActiveSheet.Cells(1, 2).Select

End Sub

In the existing code the column/row references are static. Ideally I would
like the column/row references to be dependent on what figures are listed in
cells A1 & B1, however you cannot simply enter those in 1 & 2's spot or it
will error. Help!
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,986
Default **URGENT** Macro to find a Cell

Here is one way:

Dim x As Long
Dim y As long

x = Range("A1").Value
y = Range("B1").Value

Sheets("Revised").Activate
ActiveSheet.Cells(x, y).Select

"Lost" wrote:

If I have the column row references given on 2 cells in my spreadsheet, I
need a macro to read the contents of the two cells and then select that
particular cell.

Here is the current code I have:

Sub test()

Sheets("Revised").Activate
ActiveSheet.Cells(1, 2).Select

End Sub

In the existing code the column/row references are static. Ideally I would
like the column/row references to be dependent on what figures are listed in
cells A1 & B1, however you cannot simply enter those in 1 & 2's spot or it
will error. Help!

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,939
Default **URGENT** Macro to find a Cell

I would be inclined to leave Y as being of type variant. That way the user
can enter either a column letter or number as needed...
--
HTH...

Jim Thomlinson


"JLGWhiz" wrote:

Here is one way:

Dim x As Long
Dim y As long

x = Range("A1").Value
y = Range("B1").Value

Sheets("Revised").Activate
ActiveSheet.Cells(x, y).Select

"Lost" wrote:

If I have the column row references given on 2 cells in my spreadsheet, I
need a macro to read the contents of the two cells and then select that
particular cell.

Here is the current code I have:

Sub test()

Sheets("Revised").Activate
ActiveSheet.Cells(1, 2).Select

End Sub

In the existing code the column/row references are static. Ideally I would
like the column/row references to be dependent on what figures are listed in
cells A1 & B1, however you cannot simply enter those in 1 & 2's spot or it
will error. Help!

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,986
Default **URGENT** Macro to find a Cell

Hi Jim, That's true. I just looked at the syntax the OP used and went with
that. I don't even know which cells were to be used for row or column, but
thought I would at least get them pointed in the right direction.

"Jim Thomlinson" wrote:

I would be inclined to leave Y as being of type variant. That way the user
can enter either a column letter or number as needed...
--
HTH...

Jim Thomlinson


"JLGWhiz" wrote:

Here is one way:

Dim x As Long
Dim y As long

x = Range("A1").Value
y = Range("B1").Value

Sheets("Revised").Activate
ActiveSheet.Cells(x, y).Select

"Lost" wrote:

If I have the column row references given on 2 cells in my spreadsheet, I
need a macro to read the contents of the two cells and then select that
particular cell.

Here is the current code I have:

Sub test()

Sheets("Revised").Activate
ActiveSheet.Cells(1, 2).Select

End Sub

In the existing code the column/row references are static. Ideally I would
like the column/row references to be dependent on what figures are listed in
cells A1 & B1, however you cannot simply enter those in 1 & 2's spot or it
will error. 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
urgent help!find&press,please Alex Excel Discussion (Misc queries) 0 February 18th 10 11:37 AM
Macro to insert formula using cell reference/text - Urgent stuck4once Excel Programming 2 August 7th 08 01:49 PM
Find first value in row + add following values (Please, Urgent) Evgeny Excel Discussion (Misc queries) 5 March 15th 06 06:50 PM
find next? urgent cwatson[_8_] Excel Programming 15 June 29th 05 02:37 PM
URGENT! Find and delete row macro newmand2[_3_] Excel Programming 2 May 4th 04 05:47 PM


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

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"