Search results

  1. D

    Extracting a date from a text string

    I saw the extra bracket after I posted. :D I'm not using the spreadsheet as a linked table - I'm just opening it, pulling data out of it and closing it. The spreadsheet name changes weekly. Now I am getting a type mismatch error on this modified statement: strStart = Mid(Range("A7").Value...
  2. D

    Extracting a date from a text string

    I'm using Access VBA to extract this data from an Excel spreadsheet and store it in a table.
  3. D

    Extracting a date from a text string

    Maybe I'm not understanding the flow of this routine - I have a couple of questions. Am I supposed to call this sub from another? Do I need to pass it any parameters? What does it return? What is the significance of the references to cells b7 and c7? The string in question is always in A7...
  4. D

    Extracting a date from a text string

    I'm trying to use this: dStart_date = Mid(Range("A7").value,7,InStr(Range("A7").value," To")-1)-7) But I'm getting a compile error that says Expected: End of statement. Is there a typo that you can see that I am missing? Thanks
  5. D

    Extracting a date from a text string

    I have a text string in an Excel spreadsheet that I am trying to split into a start date and an end date and store them in the start_date and end_date fields in an Access table. The string looks like this and is always in the A7 cell of this spreadsheet: From: 3/2/2018 To: 3/8/2018 I am using...
  6. D

    Extracting data from Excel

    Absolutely! There is no nerd buzz when somebody does all the work for you! :D But - the help I received from you and others on this forum has taught me so much! Let's mark this one solved. How do I do that?
  7. D

    Extracting data from Excel

    Yes - I did go step through it and found the problems. Everything is working now and I learned a great deal in the process. Here's the code for the whole import subroutine, in case it helps anybody else. If you see any glaring errors, feel free to point them out to me. Thanks to everyone...
  8. D

    Extracting data from Excel

    I only did the hard coding for testing to make sure the fields in the table were being populated correctly. I'm having trouble getting the code you provided to work in my situation - I am sure I am missing something. Here is the code you posted in other thread, with only a couple of...
  9. D

    Extracting data from Excel

    There is a typo in that last part - the cell address for lngShot3 should be N31. Typing is hard. :) Please look at the highlighted lines on the attached screenshot at how this is laid out in the spreadsheet. There might be 1 of these lines but there might be several. I coded it with 3 just...
  10. D

    Importing non-contiguous ranges from Excel

    Yes - that is the correct output. I just posted a new thread on this that has the code. The question is what to do if I don't know how many values there will be to concatenate or add together. Here's the link to the new thread: https://www.access-programmers.co.uk/forums/showthread.php?t=298621
  11. D

    Extracting data from Excel

    [SOLVED] Extracting data from Excel I am using the code below to extract data from an Excel spreadsheet that is generated by another program. It's all working except for one thing. Please look at the section in red text. I need to make a comma separated list of those bulk ids and put them...
  12. D

    Importing non-contiguous ranges from Excel

    Does anybody have any advice on my last post or should I start a new thread? Thanks, Diana
  13. D

    Importing non-contiguous ranges from Excel

    I have additional questions about extracting data from Excel when the start and end cell address are unknown. Please see the highlight part of the attached screenshot. I need to make a comma separated list of those bulk ids and put them all in a field in the table. There are not always 3 of...
  14. D

    Importing non-contiguous ranges from Excel

    I know - I don't normally use spaces or special characters. I inherited this database and am having to work around stuff that was done long before I got this. It would be a nightmare to go back and change everything. But, I do appreciate your help. I did manage to get it working, thanks to...
  15. D

    Importing non-contiguous ranges from Excel

    The debugger stops on the first line shown in red text above. The error message is an Access msgbox that says "3265 - Item not found in this collection". That error makes no sense to me.
  16. D

    Importing non-contiguous ranges from Excel

    I'm bumping into my own ignorance here - I hope you folks are willing to educate me. The form has a "Select File to Import" button that runs this code: Private Sub CmdPickFile_Click() strInitialDir = "U:\" Me.TextImport = Nz(GetOpenFile(strInitialDir, "Select File"), "") End Sub...
  17. D

    Importing non-contiguous ranges from Excel

    Yes - I am implementing the changes now. I really appreciate it.
  18. D

    Importing non-contiguous ranges from Excel

    I'll give that a try! Thanks!
  19. D

    Importing non-contiguous ranges from Excel

    When I call this fChooseFile function, I get a compile error - user -defined type not defined. It crashes here: Dim fDialog As Office.FileDialog Am I missing a declaration somewhere?
  20. D

    Importing non-contiguous ranges from Excel

    The number of values towards the bottom - the bulk items - will be tricky. There are not always three - sometimes there is just one, sometimes there are none. If there are more than one, I'll have do some tricky concatenation because I'll need them all in the same field. For clarification...
Back
Top Bottom