LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.newusers
mickle026
 
Posts: n/a
Default Getting a cell address from Vlookup function in a macro?


Does anyone know how to get the cells address from a vlookup funtion in
a macro, Im relatively new to excel and learning fast, but keep comin
up against brick walls!

What I have done, is a lookup sheet where i type in a number and if its
found in a table in another sheet, it returns values from other columns,
ie name/address, but i want to be able to select the name from my lookup
sheet and mark it by painting the cell, the painting bit i can do, i
just cant figure out how to get the cells address from the vlookup
function, any ideas?

ie,

Sheets("Lookup").Select
Range("G5").Select ' my lookup value is in this box
' c[-6]:c[3] = A:J
ActiveCell.FormulaR1C1 = "=VLOOKUP(R5C7,'Phone
List'!C[-6]:C[3],6,FALSE)"

' i have place a button on the sheet with this code:

Sheets("Phone List").Select
'Range(" --- here i need an address --- ").Select
ActiveCell.Select
' paint yellow
With Selection.Interior
.ColorIndex = 6
.Pattern = xlSolid
End With
' go back to lookup sheet
Sheets("Lookup").Select


please help me .... thanks


--
mickle026
------------------------------------------------------------------------
mickle026's Profile: http://www.excelforum.com/member.php...o&userid=35518
View this thread: http://www.excelforum.com/showthread...hreadid=552904

 
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
Custom functions calculating time arguments Help Desperate Bill_De Excel Worksheet Functions 12 April 25th 06 02:22 AM
Row Expansion Susan Excel Worksheet Functions 11 February 28th 06 07:15 PM
ADDRESS function - dynamic input cell claytorm Excel Discussion (Misc queries) 1 June 28th 05 02:05 PM
How do I obtain the address of a cell using the vlookup function? Spock Excel Worksheet Functions 2 May 16th 05 06:35 PM
Help Pls re macro cell address Hugh Jago Excel Discussion (Misc queries) 2 January 5th 05 09:01 PM


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