Hi, I have a last small problem. I tried everything, but I can't nail it.
I have a closed external file. In this file I have two columns A and B. A contains names and B personal messages.
In the "internal" Excel 2003 file I have a multipage userform. On the second page I have a textbox that has to show the personal message on the basis of the name entered in the first page (textbox "Naam"). How do I do that? I think it's handy to put the code in the button on page 1 that navigates to page 2.
Dim ExtBk As Workbook Dim ExtFile As String ExtFile = "K:\Boodschap.xls" Set ExtBk = Workbooks(Dir(ExtFile)) Message.Value = Application.VLookup(Naam.Value, ExtBk.Sheets("sheet1").Range("A1:B20"), 2, 0)
Why do you need VBA, VLOOKUP works across workbooks
Hope that helps.
RoyUK
--------
If you are pleased with a member's answer then use the Star icon to rate it, if you are pleased enough to part with cash consider a donation to Children in Need
For Excel Tips & Solutions, free examples and tutorials why not check out my downloads
New members please read & follow the Forum Rules
Remember to mark your questions Solved and rate the answer(s)
I need VBA because I use a userform. This is managed by VBA.
To best describe or illustrate your problem you would be better off attaching a dummy workbook, the workbook should contain the same structure and some dummy data of the same type as the type you have in your real workbook - so, if a cell contains numbers & letters in this format abc-123 then that should be reflected in the dummy workbook.
If needed supply a before and after sheet in the workbook so the person helping you can see what you are trying to achieve.
Doing this will ensure you get the result you need!
Hope that helps.
RoyUK
--------
If you are pleased with a member's answer then use the Star icon to rate it, if you are pleased enough to part with cash consider a donation to Children in Need
For Excel Tips & Solutions, free examples and tutorials why not check out my downloads
New members please read & follow the Forum Rules
Remember to mark your questions Solved and rate the answer(s)
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks