Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
R D S
 
Posts: n/a
Default

Cheers Dave, that is pretty much the way I ended up going about it. I seem
to remember reading somewhere that it was scorned upon to do calculations on
the sheet while running vb.
If it works its good for me though.

Rick

Dave Peterson wrote:
|| I think a pretty easy way to accomplish this is to put that formula
|| in an out of the way spot (maybe A1 of a hidden worksheet).
||
|| Then have your code update B1 of that worksheet when you leave
|| textbox1.
||
|| Option Explicit
|| Private Sub TextBox1_Exit(ByVal Cancel As MSForms.ReturnBoolean)
||
|| With ThisWorkbook.Worksheets("Hidden")
|| .Range("b1").Value = Me.TextBox1.Value
|| 'application.calculate
|| Me.TextBox2.Value = .Range("a1").Value
|| End With
||
|| End Sub
||
|| Maybe even toss in an application.calculate if you think it's
|| necessary.
||
|| R D S wrote:
|||
|||
=IF(ISNA(VLOOKUP($B$1,'E:\[RxeyeBatch.xls]Sheet1'!$A:$AI,3,FALSE)),"",VLOOKU
||| P($B$1,'E:\[RxeyeBatch.xls]Sheet1'!$A:$AI,3,FALSE))
|||
||| OK....
||| the above formula works on the sheet.
||| i am trying to implement the above into a userform and instead of
||| looking at cell B1 the lookup value is data entered into a txtbox
||| named 'reference' and the value needs to be returned to the next
||| textbox in the userform which is named 'name'.
|||
||| Thanks,
||| Rick
|||
||| Jim Rech wrote:
||||| With such a generic question a specific answer isn't possible.
||||| But in general if you can write a formula in a cell that returns
||||| the result you want, yes, you can do it from VB.
|||||
||||| --
||||| Jim Rech
||||| Excel MVP
||||| "R D S" wrote in message
||||| ...
|||||| Hi,
|||||| If I enter a number into a userform in a box called 'reference'
|||||| can I then use a vlookup to fill in the next box 'name' from an
|||||| external file?
|||||| I can use the vlookup on a sheet but am not sure of the syntax?
|||||| within VBa.
||||||
|||||| TIA,
|||||| Rick
||
|| --
||
|| Dave Peterson




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
Vlookup info being used without vlookup table attached? Excel Worksheet Functions 0 January 25th 05 10:43 AM
Need help with modifying VLookUp Tom Excel Discussion (Misc queries) 4 December 2nd 04 12:44 AM
VLOOKUP not working Scott Excel Worksheet Functions 3 November 12th 04 08:06 PM
Using Cell references in VLookUp JonWilson631 Excel Worksheet Functions 1 November 4th 04 02:49 AM
vlookup. Amit Excel Worksheet Functions 2 November 3rd 04 12:34 PM


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