Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 22
Default hlookup via vba

Hello all,

I am trying to lookup a certain value, "VALUE", in a range on a certain
sheet, then once the cell is found with that word, offset by one column and
copy thae value in the adjacent cell. this data is then returned to a
separate sheet and pasted in a specified cell. Following is my current
attempt at this, but it isn't returing the desired result. Any help?

The first macro gets the value of the loadstep and feeds it into the second
macro. This part works fine, as the pasting of "Load Step" & loadstep in the
second macro works as intended.

Sub feed_loadstep()
Summary.Activate
Range("a115:d119").ClearContents

Sheets("LoadSteps").Activate
Do While Cells(5 + i, 1) < ""
LS = Cells(5 + i, 1)

Call read_disp_3(LS)

Sheets("LoadSteps").Activate
i = i + 1
Loop
Summary.Activate
End Sub

Sub read_disp_3(loadstep)
Dim myrange, c

Summary.Activate
Summary.Range("b115").Activate

Cells(115 + loadstep - 1, 1).value = "Load Step " & loadstep
Sheets("disp_ls" & loadstep).Select

myrange = ActiveSheet.Range("b:b")

For Each c In myrange
If c = "VALUE" Then
c.Select 'this appears to be the problem, how would you
select the
'correct cell?
ActiveCell.Offset(rowoffset:=0, columnoffset:=1).Select
Selection.Copy
Summary.Activate
Cells(115 + loadstep - 1, 2) = 1
ActiveSheet.Paste
Exit For
End If
Next c

End Sub


Thanks for any help.

Jason
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
Hlookup Lindyloo Excel Discussion (Misc queries) 1 March 2nd 09 04:05 PM
HLOOKUP and SUM [email protected] Excel Discussion (Misc queries) 1 October 26th 06 05:27 PM
hlookup tikchye_oldLearner57 Excel Discussion (Misc queries) 4 August 24th 06 12:46 PM
Hlookup lmullenjr Excel Discussion (Misc queries) 3 August 18th 06 07:15 PM
Hlookup? coa01gsb Excel Worksheet Functions 5 March 9th 06 02:03 PM


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