Home |
Search |
Today's Posts |
#5
![]() |
|||
|
|||
![]()
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 |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Vlookup info being used without vlookup table attached? | Excel Worksheet Functions | |||
Need help with modifying VLookUp | Excel Discussion (Misc queries) | |||
VLOOKUP not working | Excel Worksheet Functions | |||
Using Cell references in VLookUp | Excel Worksheet Functions | |||
vlookup. | Excel Worksheet Functions |