#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 189
Default MATCH formula

hi,
I've got a formula like: =match(A6, SHEET2A4:A100,0) and I want to have a
COMMAND BUTTON and instead of A6 in the formula ,I like to have a variable(I
mean a dynamic value) like activecell so that when I press the COMMAND
BUTTON, the formula functions for the cell I'm on.
Is there a way?
Thanks,
Peiman
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 9,101
Default MATCH formula

What you asked for will produce a circular calculation. You want a fixed
offset from the active cell to place either the formula or the A6 location.
With a macro, you can have a pop up come up to select the cell. Do you want
a macro?

"peyman" wrote:

hi,
I've got a formula like: =match(A6, SHEET2A4:A100,0) and I want to have a
COMMAND BUTTON and instead of A6 in the formula ,I like to have a variable(I
mean a dynamic value) like activecell so that when I press the COMMAND
BUTTON, the formula functions for the cell I'm on.
Is there a way?
Thanks,
Peiman

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11,501
Default MATCH formula

Hi,

I assume when you say you want the formula functions for the cell you are on
then this is the lookup value

Private Sub CommandButton1_Click()
LookupValue = ActiveCell.Value
On Error Resume Next
myvalue = WorksheetFunction.Match(LookupValue, _
Sheets("Sheet2").Range("A4:A100"), 0)
End Sub

Mike

"peyman" wrote:

hi,
I've got a formula like: =match(A6, SHEET2A4:A100,0) and I want to have a
COMMAND BUTTON and instead of A6 in the formula ,I like to have a variable(I
mean a dynamic value) like activecell so that when I press the COMMAND
BUTTON, the formula functions for the cell I'm on.
Is there a way?
Thanks,
Peiman

  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 189
Default MATCH formula

Thanx Joel,
I'M Okay with Macro but let me clarify more what I need to do, the A6 or the
active cell I need to find the match is in sheet 1. My purpose is when,for
example, I'm on cell F24 in sheet 1 ,by pressing the COMMAND BUTTON I'll be
transfered to the corresponding cell(there is a cell with the same content of
F24 in sheet 2) in sheet 2. I hope I'm clear on that.
Thanx,


"Joel" wrote:

What you asked for will produce a circular calculation. You want a fixed
offset from the active cell to place either the formula or the A6 location.
With a macro, you can have a pop up come up to select the cell. Do you want
a macro?

"peyman" wrote:

hi,
I've got a formula like: =match(A6, SHEET2A4:A100,0) and I want to have a
COMMAND BUTTON and instead of A6 in the formula ,I like to have a variable(I
mean a dynamic value) like activecell so that when I press the COMMAND
BUTTON, the formula functions for the cell I'm on.
Is there a way?
Thanks,
Peiman

  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 189
Default MATCH formula

thanx let me try

"Mike H" wrote:

Hi,

I assume when you say you want the formula functions for the cell you are on
then this is the lookup value

Private Sub CommandButton1_Click()
LookupValue = ActiveCell.Value
On Error Resume Next
myvalue = WorksheetFunction.Match(LookupValue, _
Sheets("Sheet2").Range("A4:A100"), 0)
End Sub

Mike

"peyman" wrote:

hi,
I've got a formula like: =match(A6, SHEET2A4:A100,0) and I want to have a
COMMAND BUTTON and instead of A6 in the formula ,I like to have a variable(I
mean a dynamic value) like activecell so that when I press the COMMAND
BUTTON, the formula functions for the cell I'm on.
Is there a way?
Thanks,
Peiman



  #6   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 189
Default MATCH formula

Mike,
I used the macro but nothing happened!!
I'm not transfered to sheet2!! where the result can be seen?!

"Mike H" wrote:

Hi,

I assume when you say you want the formula functions for the cell you are on
then this is the lookup value

Private Sub CommandButton1_Click()
LookupValue = ActiveCell.Value
On Error Resume Next
myvalue = WorksheetFunction.Match(LookupValue, _
Sheets("Sheet2").Range("A4:A100"), 0)
End Sub

Mike

"peyman" wrote:

hi,
I've got a formula like: =match(A6, SHEET2A4:A100,0) and I want to have a
COMMAND BUTTON and instead of A6 in the formula ,I like to have a variable(I
mean a dynamic value) like activecell so that when I press the COMMAND
BUTTON, the formula functions for the cell I'm on.
Is there a way?
Thanks,
Peiman

  #7   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11,501
Default MATCH formula

Hi,

I've only just understood what you want. try this.

View|Toolbars|Forma and put a button on your sheet. Click 'New' on the popup
and paste the code below in and try it

LookupValue = ActiveCell.Value
On Error Resume Next
myvalue = WorksheetFunction.Match(LookupValue, _
Sheets("Sheet2").Range("A4:A100"), 0)
Sheets("Sheet2").Select
Sheets("Sheet2").Range("A" & myvalue + 3).Select

Mike

"peyman" wrote:

Mike,
I used the macro but nothing happened!!
I'm not transfered to sheet2!! where the result can be seen?!

"Mike H" wrote:

Hi,

I assume when you say you want the formula functions for the cell you are on
then this is the lookup value

Private Sub CommandButton1_Click()
LookupValue = ActiveCell.Value
On Error Resume Next
myvalue = WorksheetFunction.Match(LookupValue, _
Sheets("Sheet2").Range("A4:A100"), 0)
End Sub

Mike

"peyman" wrote:

hi,
I've got a formula like: =match(A6, SHEET2A4:A100,0) and I want to have a
COMMAND BUTTON and instead of A6 in the formula ,I like to have a variable(I
mean a dynamic value) like activecell so that when I press the COMMAND
BUTTON, the formula functions for the cell I'm on.
Is there a way?
Thanks,
Peiman

  #8   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11,501
Default MATCH formula

Hi

A bit of error trapping

LookupValue = ActiveCell.Value
On Error Resume Next
myvalue = WorksheetFunction.Match(LookupValue, _
Sheets("Sheet2").Range("A4:A100"), 0)
If myvalue < "" Then
Sheets("Sheet2").Select
Sheets("Sheet2").Range("A" & myvalue + 3).Select
Else
MsgBox "Lookup value " & ActiveCell.Value & " Not found"
End If

Mike

"Mike H" wrote:

Hi,

I've only just understood what you want. try this.

View|Toolbars|Forma and put a button on your sheet. Click 'New' on the popup
and paste the code below in and try it

LookupValue = ActiveCell.Value
On Error Resume Next
myvalue = WorksheetFunction.Match(LookupValue, _
Sheets("Sheet2").Range("A4:A100"), 0)
Sheets("Sheet2").Select
Sheets("Sheet2").Range("A" & myvalue + 3).Select

Mike

"peyman" wrote:

Mike,
I used the macro but nothing happened!!
I'm not transfered to sheet2!! where the result can be seen?!

"Mike H" wrote:

Hi,

I assume when you say you want the formula functions for the cell you are on
then this is the lookup value

Private Sub CommandButton1_Click()
LookupValue = ActiveCell.Value
On Error Resume Next
myvalue = WorksheetFunction.Match(LookupValue, _
Sheets("Sheet2").Range("A4:A100"), 0)
End Sub

Mike

"peyman" wrote:

hi,
I've got a formula like: =match(A6, SHEET2A4:A100,0) and I want to have a
COMMAND BUTTON and instead of A6 in the formula ,I like to have a variable(I
mean a dynamic value) like activecell so that when I press the COMMAND
BUTTON, the formula functions for the cell I'm on.
Is there a way?
Thanks,
Peiman

  #9   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 189
Default MATCH formula

thanx Mike it works great!! but why did you add myValue + 3? I don't get it.


"Mike H" wrote:

Hi,

I've only just understood what you want. try this.

View|Toolbars|Forma and put a button on your sheet. Click 'New' on the popup
and paste the code below in and try it

LookupValue = ActiveCell.Value
On Error Resume Next
myvalue = WorksheetFunction.Match(LookupValue, _
Sheets("Sheet2").Range("A4:A100"), 0)
Sheets("Sheet2").Select
Sheets("Sheet2").Range("A" & myvalue + 3).Select

Mike

"peyman" wrote:

Mike,
I used the macro but nothing happened!!
I'm not transfered to sheet2!! where the result can be seen?!

"Mike H" wrote:

Hi,

I assume when you say you want the formula functions for the cell you are on
then this is the lookup value

Private Sub CommandButton1_Click()
LookupValue = ActiveCell.Value
On Error Resume Next
myvalue = WorksheetFunction.Match(LookupValue, _
Sheets("Sheet2").Range("A4:A100"), 0)
End Sub

Mike

"peyman" wrote:

hi,
I've got a formula like: =match(A6, SHEET2A4:A100,0) and I want to have a
COMMAND BUTTON and instead of A6 in the formula ,I like to have a variable(I
mean a dynamic value) like activecell so that when I press the COMMAND
BUTTON, the formula functions for the cell I'm on.
Is there a way?
Thanks,
Peiman

  #10   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11,501
Default MATCH formula

Hi,

It was because your range started in A4, Index returned the position of the
lookup value in the array so if it finds in in A4 it returns 1 so adding 3
gives me the correct row in the worksheet in the worksheet.

Mike

"peyman" wrote:

thanx Mike it works great!! but why did you add myValue + 3? I don't get it.


"Mike H" wrote:

Hi,

I've only just understood what you want. try this.

View|Toolbars|Forma and put a button on your sheet. Click 'New' on the popup
and paste the code below in and try it

LookupValue = ActiveCell.Value
On Error Resume Next
myvalue = WorksheetFunction.Match(LookupValue, _
Sheets("Sheet2").Range("A4:A100"), 0)
Sheets("Sheet2").Select
Sheets("Sheet2").Range("A" & myvalue + 3).Select

Mike

"peyman" wrote:

Mike,
I used the macro but nothing happened!!
I'm not transfered to sheet2!! where the result can be seen?!

"Mike H" wrote:

Hi,

I assume when you say you want the formula functions for the cell you are on
then this is the lookup value

Private Sub CommandButton1_Click()
LookupValue = ActiveCell.Value
On Error Resume Next
myvalue = WorksheetFunction.Match(LookupValue, _
Sheets("Sheet2").Range("A4:A100"), 0)
End Sub

Mike

"peyman" wrote:

hi,
I've got a formula like: =match(A6, SHEET2A4:A100,0) and I want to have a
COMMAND BUTTON and instead of A6 in the formula ,I like to have a variable(I
mean a dynamic value) like activecell so that when I press the COMMAND
BUTTON, the formula functions for the cell I'm on.
Is there a way?
Thanks,
Peiman



  #11   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 189
Default MATCH formula

got it. Thanx a lot.

"Mike H" wrote:

Hi,

It was because your range started in A4, Index returned the position of the
lookup value in the array so if it finds in in A4 it returns 1 so adding 3
gives me the correct row in the worksheet in the worksheet.

Mike

"peyman" wrote:

thanx Mike it works great!! but why did you add myValue + 3? I don't get it.


"Mike H" wrote:

Hi,

I've only just understood what you want. try this.

View|Toolbars|Forma and put a button on your sheet. Click 'New' on the popup
and paste the code below in and try it

LookupValue = ActiveCell.Value
On Error Resume Next
myvalue = WorksheetFunction.Match(LookupValue, _
Sheets("Sheet2").Range("A4:A100"), 0)
Sheets("Sheet2").Select
Sheets("Sheet2").Range("A" & myvalue + 3).Select

Mike

"peyman" wrote:

Mike,
I used the macro but nothing happened!!
I'm not transfered to sheet2!! where the result can be seen?!

"Mike H" wrote:

Hi,

I assume when you say you want the formula functions for the cell you are on
then this is the lookup value

Private Sub CommandButton1_Click()
LookupValue = ActiveCell.Value
On Error Resume Next
myvalue = WorksheetFunction.Match(LookupValue, _
Sheets("Sheet2").Range("A4:A100"), 0)
End Sub

Mike

"peyman" wrote:

hi,
I've got a formula like: =match(A6, SHEET2A4:A100,0) and I want to have a
COMMAND BUTTON and instead of A6 in the formula ,I like to have a variable(I
mean a dynamic value) like activecell so that when I press the COMMAND
BUTTON, the formula functions for the cell I'm on.
Is there a way?
Thanks,
Peiman

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
which formula? Match? IF? shay34 Excel Worksheet Functions 4 November 13th 08 06:01 PM
match formula - 2 excel files:#1 hasthis formula, 2nd has the Raw DS Excel Worksheet Functions 4 October 7th 06 12:25 AM
How do I display more than one match in a Index/Match formula? Trish Excel Worksheet Functions 0 September 26th 05 10:21 PM
MATCH Formula Sandy Excel Worksheet Functions 3 August 12th 05 11:42 PM
Lookup Formula - but have a formula if it can't find/match a value Stephen Excel Worksheet Functions 11 June 14th 05 05:32 AM


All times are GMT +1. The time now is 01:56 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"