Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 05-09-2017, 08:32 PM
gmayor's Avatar
gmayor gmayor is offline Excel to Word data import based on UserForm entry Windows 10 Excel to Word data import based on UserForm entry Office 2016
Expert
 
Join Date: Aug 2014
Posts: 4,137
gmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud of
Default

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
which does not need a userform.
__________________
Graham Mayor - MS MVP (Word) (2002-2019)
Visit my web site for more programming tips and ready made processes www.gmayor.com
Reply With Quote
  #2  
Old 05-14-2017, 03:42 PM
jhancock1994 jhancock1994 is offline Excel to Word data import based on UserForm entry Windows 7 64bit Excel to Word data import based on UserForm entry Office 2013
Novice
Excel to Word data import based on UserForm entry
 
Join Date: May 2017
Posts: 7
jhancock1994 is on a distinguished road
Default

Unfortunately the same Invalid Use of Null error is still occurring Graham
Reply With Quote
Reply



Similar Threads
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
Excel to Word data import based on UserForm entry Import data from Excel into Word 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

Other Forums: Access Forums

All times are GMT -7. The time now is 09:39 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft