Creating Userform From Existing Macro

Joined
Jan 29, 2014
Messages
1
Reaction score
0
Hi everyone.

I'm super new to VBA, but I've learned A LOT about the coding recently. My problem is, I want to create a userform so others can use the code I've written. Thus far I've only worked out how to create a userform and THEN build the code AROUND it, I'd like to start with my code and have a userform adapt TO it.

For example, here is a section of strings from one of my Macros:

Code:
Dim Dir1 As String
Dim Dir2 As String
Dim FileName As String
Dim Ext1 As String
Dim Ext2 As String
Dim FilePath as String

'What folder is the New Template Stored in?
Dir1 = "C:\Users\XXX\Documents\Testing\ACS Test\New\"

'What is the New Template Called?
FileName = "Letter1"

'What is the New Templates File Extension? (Watch for .doc and .docx)
Ext1 = ".dot"

FilePath = (Dir1 & FileName & Ext1)

'Where are all the Existing files located?
Dir2 = "C:\Users\XXX\Documents\Testing\ACS Test\Old\"

Where I have A reference to a filepath, I'd like to call something like a String to say:

Code:
'What folder is the New Template Stored in?
Dir1 = (UserFormTextField1)

I hope this is clear, Can this be done?

Thanks :)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top