![]() |
|
#1
|
||||
|
||||
![]()
It sounds like there is no value in strResult when changed to use the userform value. Greg has shown how to use a userform value. He has not included the userform, which you will need to add to your document or modify the code to use the value selected from the userform. Userforms are difficult to reproduce in the forum.
Replace the Macro1 I provided earlier with Code:
Sub Macro1() 'look for the value in the first column and return the value in the sixth column Dim strResult As String Dim strValue As String strValue = InputBox("Enter the value to find") If strValue = "" Then MsgBox "No value entered or user cancelled" GoTo lbl_Exit End If strResult = GetValue(strValue, 6) FillBM "bookmarkname", strResult 'fill the named bookmark with the value lbl_Exit: Exit Sub End Sub
__________________
Graham Mayor - MS MVP (Word) (2002-2019) Visit my web site for more programming tips and ready made processes www.gmayor.com |
#2
|
|||
|
|||
![]()
Unfortunately the same Invalid Use of Null error is still occurring Graham
|
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Data Import from multiple word files into an Excel tale | asmanokhchi | Word | 1 | 04-21-2015 06:24 AM |
need VBA to Transpose the Data from excel to word based on given criteria(status) | winmaxservices2 | Excel Programming | 1 | 12-19-2014 10:21 PM |
![]() |
sb003848 | Word | 1 | 11-04-2014 06:30 PM |
Import excel data in to SQL Server | DavidBrown | Excel | 0 | 08-08-2011 04:49 AM |
Import Pics and Excel Data into PP? | jawillyams | PowerPoint | 0 | 03-13-2011 01:03 PM |