Results 1 to 7 of 7
  1. #1
    Euler is offline Advanced Beginner
    Windows 7 32bit Access 2010 32bit
    Join Date
    Feb 2015
    Posts
    62

    Remote Excel VBA programming problem


    I'm trying to remotely control an Excel workbook with MS Access VBA. I have a filtered column and I'd like to copy just the unique filtered items and paste them to another location to make an array. I don't want the header or any blanks in the array.

    So far, I've gotten the unique values in a new worksheet but they include the header and a blank.

    Can anyone help with this issue? Thanks for the help.

  2. #2
    Join Date
    Jan 2017
    Location
    Swansea,South Wales,UK
    Posts
    4,914
    I tend to use record macro to get the basics, then tailor to suit?
    So filter for no spaces and add that code. Skipping the headers should just be the same?
    Please use # icon on toolbar when posting code snippets.
    Cross Posting: https://www.excelguru.ca/content.php?184
    Debugging Access: https://www.youtube.com/results?sear...bug+access+vba

  3. #3
    Euler is offline Advanced Beginner
    Windows 7 32bit Access 2010 32bit
    Join Date
    Feb 2015
    Posts
    62
    I tried recording a macro but it didn't give me the results I need. I used Advanced Filtering to get the unique values and placed the results in another worksheet but I still got a blank in there.
    It also seems that I need to include the header when I select the range. Otherwise, it won't pick up some values.

  4. #4
    Join Date
    Jan 2017
    Location
    Swansea,South Wales,UK
    Posts
    4,914
    So I would walk that column and delete the row if the cell is empty.
    Then go to the top and delete the header.
    Please use # icon on toolbar when posting code snippets.
    Cross Posting: https://www.excelguru.ca/content.php?184
    Debugging Access: https://www.youtube.com/results?sear...bug+access+vba

  5. #5
    Euler is offline Advanced Beginner
    Windows 7 32bit Access 2010 32bit
    Join Date
    Feb 2015
    Posts
    62
    That's an idea that'll work, I'm sure. Thank you for that.

    Another one that I found on the internet was to create an array of unique values by walking through the unfiltered column. I haven't tried it yet but it sounds promising.

  6. #6
    Join Date
    Jan 2017
    Location
    Swansea,South Wales,UK
    Posts
    4,914
    Well if you already have code to get the unique values I would stick with that. Less to process?
    Plus you should only have one empty cell if unique values?, so exit as soon as found and row is deleted.
    Please use # icon on toolbar when posting code snippets.
    Cross Posting: https://www.excelguru.ca/content.php?184
    Debugging Access: https://www.youtube.com/results?sear...bug+access+vba

  7. #7
    Gicu's Avatar
    Gicu is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Jul 2015
    Location
    Kelowna, BC, Canada
    Posts
    4,114
    Lots of examples on this, can you show us your code? Here are some links:
    https://www.listendata.com/2013/05/e...ue-values.html
    https://stackoverflow.com/questions/...ray-from-excel

    Cheers,
    Vlad Cucinschi
    MS Access Developer
    http://forestbyte.com/

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 3
    Last Post: 12-21-2019, 06:33 PM
  2. Replies: 4
    Last Post: 05-29-2015, 09:36 AM
  3. Importing from Excel (programming part)
    By dsaxena15 in forum Programming
    Replies: 1
    Last Post: 10-15-2012, 07:47 AM
  4. Remote Access
    By tired and frustrated in forum Access
    Replies: 3
    Last Post: 01-16-2012, 10:19 AM
  5. How to Use Remote DB
    By saravanan.baskaran in forum Access
    Replies: 0
    Last Post: 01-10-2009, 03:43 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums