Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Search results for query: *

  1. NCSUVBAnewb

    Passing Data from Userform to Module

    strongm and N1GHTEYES, you guys have been a HUGE help! I avoided using the Public variable declaration as I understand that can be dangerous and instead am using the Public Properties. N1GHTEYES, I made the changes you recommended and I now have that GetData property working for all variables...
  2. NCSUVBAnewb

    Passing Data from Userform to Module

    The declaration is the same as in all previous windows of code
  3. NCSUVBAnewb

    Passing Data from Userform to Module

    I assign InsString here: Private Sub cmdCancel_Click() Unload Me End Sub Private Sub cmdOK_Click() MonthDay = YYMM.Text InsString = cboCoord.Text CalDate = cboDay.Text Hide End Sub Public Property Get GetData() As Variant GetData = InsString End Property Private Sub...
  4. NCSUVBAnewb

    Passing Data from Userform to Module

    Tony, Here are the adjustments I made: Module: Option Explicit Dim MonthDay As String Dim InsString As String Dim CalDate As String Sub InputDate() FindInput.Show InsString = FindInput.GetData Call ImportData End Sub Sub ImportData() Workbooks.OpenText...
  5. NCSUVBAnewb

    Passing Data from Userform to Module

    Skip, InsString is supposed to be filled by the UserForm value for the ComboBox. Tony, Thank you very much for writing that out for me, I'll implement that now and see how things go.
  6. NCSUVBAnewb

    Passing Data from Userform to Module

    Hey all, I've got a VBA module that runs a userform that prompts for a certain set of data, finds and opens a file based on the user input, inputs and formats that data, and saves to a new directory. I'm having difficulties passing the data as variables from the UserForm I created back to the...
  7. NCSUVBAnewb

    Import Text into Excel with VBA HELP???

    Skip, Sorry for the confusion, I now understand the differences between the two. I've revised my entire code, now working much better. Thank you so much for guiding me through these first through difficult days of misunderstanding :)
  8. NCSUVBAnewb

    Import Text into Excel with VBA HELP???

    I originally wanted to run the code just as a .vbs file written in notepad, but because of the excessive difficulties I have decided to rewrite it. Now I have a macro that runs in Excel - user opens and imports data using wizard, then runs macro which formats and saves file into new directory.
  9. NCSUVBAnewb

    Import Text into Excel with VBA HELP???

    To run the script external to Excel, have it import and format the data, and close. I don't plan to reference this workbook anywhere else, I just want to open, import, format, save, close, repeat.
  10. NCSUVBAnewb

    Import Text into Excel with VBA HELP???

    So this is coded in Excel, but my ultimate goal is to run this external to Excel and have the script open and process all the data for me. Because theres a large number of files, I want to have a script that I run separately that grinds through each data import for me. I could easily just do...
  11. NCSUVBAnewb

    Import Text into Excel with VBA HELP???

    The following is the rearranged first few lines of my code: Option Explicit Dim objXL Sub AddNew() Set NewBook = Workbooks.Add With NewBook .Title = "TEST" .Subject = "TEST" .SaveAs Filename="TEST.xlsm" End With End Sub Set objXL = CreateObject("Excel.Application") objXL.Visible =...
  12. NCSUVBAnewb

    Import Text into Excel with VBA HELP???

    Skip, Thanks for clarifying, I read up about procedure-module-project level variables and it makes more sense now. Now, I rearraged the code such that Sub AddNew is now above the object declaration for objXL. I have not changed any of the merge and/or selection commands just yet, but thats...
  13. NCSUVBAnewb

    Import Text into Excel with VBA HELP???

    I really am new to this so could you clarify a little more what you mean by not placing a code above procedure? Secondly, when I use the Option Explicit command, it requires that I declare all variables. I am a little confused about the objXL object being a variable, must be my unfamiliarity...
  14. NCSUVBAnewb

    Import Text into Excel with VBA HELP???

    Hey all, I'm new to this forum and VB in general (only been using for 2 days now) and I need some help executing a text import into Excel. I've got a series of text files with columns of data that import just fine into Excel using the Import Data Wizard, but I'd like to automate this process...

Part and Inventory Search

Back
Top