View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
DavidC[_3_] DavidC[_3_] is offline
external usenet poster
 
Posts: 1
Default A Macro to autofind a value in a range

Try this I take it that the comboboxes are on sheet1, and
sheet 2 has the exchange rate table. It assumes that the
list of currencies in the first column is the same order
as the currencies in each of the 30 columns. Assign this
routine to the second combobox which is selected.:


Dim rg1 As String, rg2 As String

row1 = ActiveSheet.Range("A40").Value 'row reference
row2 = ActiveSheet.Range("A41").Value 'column reference

Worksheets("Sheet2").Activate
ActiveSheet.Cells(row1 + 1, 1).Select
ActiveCell.Offset(0, row2).Select

exRate = ActiveCell.Value


-----Original Message-----
OK, Ill do my best to describe what I am trying to

achieve, all help appreciated, so lets set the scene!:

I have put together a table for viewing various exchange

rates (roughly 30 rows by 30 columns to be precise) with a
view to being able to automatically extract the correct
rate from it in conjuction with a combobox as the means
for doing this.

Worksheet 1 contains a 'select the currency from'

combobox list and a 'select the currency to' combobox list

Worksheet 2 has the exchange rate table in it.

What I want to achieve is when an exchange rate is

selected from the 2 combo boxes on worksheet 1 it triggers
a formula to go to worksheet 2, read and publish the
appropriate rate but I have run out of ideas to do this,
help please!!

The logic I have been trying to apply is to name each of

the rows and colums of figures in the table (Lets say for
example the row of USD Dollar rates, USD and the column of
UK Pound Rates, UKP) there will then be only one instance
where those ranges contain the same cell, ie where they
cross and that would give me the rate i need :)

I would use the comboboxes to give me the required

currencies in the linked cells and then use the answers in
the linked cells in someway to read the correct rate from
the currency table.

Help please.

Thanks

.