Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8,520
Default VB error '1004' Unable to get VLookup property to work right

Try the below...Declared as variant,

Sub Macro()
Dim Location As Variant ' number used to look for city
Location = 1
Worksheets("Master").Activate
With ActiveSheet
..Range("V3") = Application.WorksheetFunction.VLookup(Location, _
Sheets("City").Range("A2:B3"), 2, False)
End With
End Sub

If this post helps click Yes
---------------
Jacob Skaria


"NFL" wrote:

I'm getting a run-time error 1004 and don't know what is missing. I have 2
columns in the City worksheet as shown below. Thank you!

A B
Location City
1 Springfield
2 Dallas
3 etc. etc..

I want the Master worksheet to look for a city/town in the City worksheet
and place that value in V3.

dim Location as string ' number used to look for city

Worksheets("Master").Activate
With ActiveSheet
.Range("V3") = Application.WorksheetFunction.VLookup(Location,
Sheets("City").Range("A2:B3"), 2, False)

End With

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
Runtime Error 1004 Unable to set the top property of the picture c JB Bates[_2_] Excel Discussion (Misc queries) 1 March 3rd 10 08:04 PM
Error 1004 - unable to set the FormulaArray property of the Range diepvic Excel Programming 6 June 25th 09 09:21 PM
Error 1004: Unable to get the axis property Ana via OfficeKB.com Charts and Charting in Excel 1 June 24th 09 11:47 AM
Run Time Error 1004 Unable to set hidden property Lester Lee Excel Programming 3 July 22nd 04 03:31 AM
Run-time Error '1004' Unable to get the findnext property... Tom Ogilvy Excel Programming 0 July 12th 04 04:27 PM


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