LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Hlookup Errors


Hi,

I'm trying to use an hlookup function in vba to search for data in
another open workbook. However, I seem to keep getting errors back as
results. My only problem is that I can only specify the range for the
hlookup as a range from an active cell that I am searching for on the
initial spreadsheet (named RData below)



I am using the below syntax, but it doesn't seem to work (I just get
the error message "unable to get the hlookup property of the worksheet
function class")

One thing I thought it might be is that my range has an activecell
reference in it. I then change spreadsheet and use an activecell
reference on this new spreadsheet, but still use the above range in the
same hlookup - but I'm not sure if this would really matter?

If anyone can see what I am doing wrong it would be gratefully
appreciated or is there an easier way of doing this rather than using
hlookup?

Thanks


Joe








Dim riskd
Dim RiskE As String
RiskE = "ER (Pure)%"


Worksheets("RData").Activate
Range("b7").Select


Do
If ActiveCell = RiskE Then
ActiveCell.Offset(3, 1).Select
Else: ActiveCell.Offset(9, 0).Select
End If
Loop Until ActiveCell = RiskE
ActiveCell.Offset(3, 1).Select

riskd = ActiveCell.Range("A1:AA2").Select


Workbooks("Risk Dec").Activate
Worksheets("Equity").Activate
ActiveCell.Offset(0, 1).Select


ActiveCell = Application.HLookup(ActiveCell.End(xlUp),
riskd, 1, False)


--
jlejehan
------------------------------------------------------------------------
jlejehan's Profile: http://www.excelforum.com/member.php...o&userid=33950
View this thread: http://www.excelforum.com/showthread...hreadid=541137

 
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
hlookup help stew Excel Discussion (Misc queries) 5 June 24th 09 01:12 PM
Hlookup? Eden397 Excel Worksheet Functions 1 June 6th 07 03:43 PM
Excel Throwing Circular Errors When No Errors Exist MDW Excel Worksheet Functions 1 August 10th 06 02:15 PM
Hlookup jo2389hn Excel Programming 0 July 19th 05 03:55 PM
Unresolved Errors in IF Statements - Errors do not show in results Markthepain Excel Worksheet Functions 2 December 3rd 04 08:49 AM


All times are GMT +1. The time now is 12:10 AM.

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"