+ Reply to Thread
Results 1 to 19 of 19

macro to lookp through column and seperate values

  1. #1
    Registered User
    Join Date
    06-08-2015
    Location
    United States
    MS-Off Ver
    2013
    Posts
    31

    macro to lookp through column and seperate values

    Hey guys,

    I am not sure where to start here

    I have 1 sheet that has a column of dates and other values

    For each non date, the values below it are associated with it

    these values need to be automated so that dates go in the date column on sheet 2 and suit:12345 go into another column.

    any ideas?

  2. #2
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2405 Win 11 Home 64 Bit
    Posts
    23,879

    Re: macro to lookp through column and seperate values

    Attach a sample workbook. Make sure there is just enough data to demonstrate your need. Include a BEFORE sheet and an AFTER sheet in the workbook if needed to show the process you're trying to complete or automate. Make sure your desired results are shown, mock them up manually if necessary.

    Remember to desensitize the data.

    Click on GO ADVANCED and use the paperclip icon to open the upload window.

    View Pic
    Alan עַם יִשְׂרָאֵל חַי


    Change an Ugly Report with Power Query
    Database Normalization
    Complete Guide to Power Query
    Man's Mind Stretched to New Dimensions Never Returns to Its Original Form

  3. #3
    Registered User
    Join Date
    06-08-2015
    Location
    United States
    MS-Off Ver
    2013
    Posts
    31

    Re: macro to lookp through column and seperate values

    Here is the sample workbook

    Thanks!
    Attached Files Attached Files

  4. #4
    Forum Expert Alf's Avatar
    Join Date
    03-13-2004
    Location
    Gothenburg/Mullsjoe, Sweden
    MS-Off Ver
    Excel 2019 and not sure I like it
    Posts
    4,758

    Re: macro to lookp through column and seperate values

    And here is your modified sample workbook.

    To test run macro "Order"

    Alf
    Attached Files Attached Files

  5. #5
    Registered User
    Join Date
    06-08-2015
    Location
    United States
    MS-Off Ver
    2013
    Posts
    31

    Re: macro to lookp through column and seperate values

    Alf,

    Thank you!

    Sorry for the delayed response. I never got a notification. I am running this now.. seems to work very well!!

    Thank you for your time on this!

  6. #6
    Registered User
    Join Date
    06-08-2015
    Location
    United States
    MS-Off Ver
    2013
    Posts
    31

    Re: macro to lookp through column and seperate values

    Alf,

    how would it be different if I needed to add 4-5 more columns of data? Of course it would be put into the corresponding worksheet.

    Also, we were in Sweden last month. Hung out in Gothenburg a good bit.. really amazing

  7. #7
    Forum Expert Alf's Avatar
    Join Date
    03-13-2004
    Location
    Gothenburg/Mullsjoe, Sweden
    MS-Off Ver
    Excel 2019 and not sure I like it
    Posts
    4,758

    Re: macro to lookp through column and seperate values

    You are welcome and thanks for feedback.

    I'm not sure how much use this could be to you. If fore instance you get bookings daily and you wish to update reservations a macro should check if sheets for that particular suite exist and if so add the new data and sort all data based on date perhaps. Or should all sheets get deleted and new sheets created whenever a macro is run?

    Sheet name "SUIT: 12348" is a "forbidden" sheet name by the way on account on the ":". This is an Excel limitation but "SUIT 12348" or "SUIT-12348" are ok sheet name.

    Alf

  8. #8
    Registered User
    Join Date
    06-08-2015
    Location
    United States
    MS-Off Ver
    2013
    Posts
    31

    Re: macro to lookp through column and seperate values

    I think I would like to keep the sheets that are originally there.. I have to make them look like a specific receipt. show ill be copying and pasting the dates that correspond with each suit starting at A22 :G22 so you can see there will be multiple columns

  9. #9
    Forum Expert Alf's Avatar
    Join Date
    03-13-2004
    Location
    Gothenburg/Mullsjoe, Sweden
    MS-Off Ver
    Excel 2019 and not sure I like it
    Posts
    4,758

    Re: macro to lookp through column and seperate values

    how would it be different if I needed to add 4-5 more columns of data?
    Upload a workbook with the all the data and I'll have a look at to see what I can do.

    Alf

  10. #10
    Registered User
    Join Date
    06-08-2015
    Location
    United States
    MS-Off Ver
    2013
    Posts
    31

    Re: macro to lookp through column and seperate values

    Alf,

    Thanks so much!

    Sorry to be a pest.
    Attached Files Attached Files

  11. #11
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,523

    Re: macro to lookp through column and seperate values

    See if this is how you wanted.
    Different method.
    Please Login or Register  to view this content.

  12. #12
    Forum Expert Alf's Avatar
    Join Date
    03-13-2004
    Location
    Gothenburg/Mullsjoe, Sweden
    MS-Off Ver
    Excel 2019 and not sure I like it
    Posts
    4,758

    Re: macro to lookp through column and seperate values

    You got a nice solution to you problem from jindon but if you still wish to have each suit on a separate sheet you could add this macro.

    Macro is based on data in the "Result" sheet jindons macro create, it autofilters data and activate appropriate sheet and copy the result without "ower writing older results. If sheet is not found macro will creates it before pasting values to it.

    Please Login or Register  to view this content.
    Alf

  13. #13
    Registered User
    Join Date
    06-08-2015
    Location
    United States
    MS-Off Ver
    2013
    Posts
    31

    Re: macro to lookp through column and seperate values

    Thanks Jindon and Alf(My Man) I am trying each this afternoon.. will let you guys know.. Thanks so much!

  14. #14
    Forum Expert Alf's Avatar
    Join Date
    03-13-2004
    Location
    Gothenburg/Mullsjoe, Sweden
    MS-Off Ver
    Excel 2019 and not sure I like it
    Posts
    4,758

    Re: macro to lookp through column and seperate values

    Having tested jindon's macro I'm impressed by its flexibility (but then after all he is a Forum Guru) because if you exstend the number of columns from I to M, O or whatever his code will cope with it wetheras mine part will fall flat on it's feet (as far as macros has feets) because I've hardcoded the number of columns in the heading

    Please Login or Register  to view this content.
    So in order to make mine code as flexcible as his I've rewritten it a bit, new code:

    Please Login or Register  to view this content.
    Alf

  15. #15
    Registered User
    Join Date
    06-08-2015
    Location
    United States
    MS-Off Ver
    2013
    Posts
    31

    Re: macro to lookp through column and seperate values

    Thanks, Alf and Jindon.

    Both work very well..i just got a added step to this thing which is frustrating... For each Suit that has its own information..

    I need to take the data and put it iN CELLS B22, C22, E25. instead OF SHEEETS 1,2 3,4 I have had to create sheets based on their suit # (I already have these...

    just need to transfer

    Date (column B ) starting at cell 22
    Code (WO, BF..) Column C starting at cell 22
    and Amount column E starting at cell 22

    each sheet is set up the exact same

    so sheet 201, 202A .. ect.

    COlumn, cell
    B,C,E 22

    I would love to learn if you could put some notes in your VBA code for me to follow.

  16. #16
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,523

    Re: macro to lookp through column and seperate values

    Can you just upload a workbook showing before/after?

  17. #17
    Registered User
    Join Date
    06-08-2015
    Location
    United States
    MS-Off Ver
    2013
    Posts
    31

    Re: macro to lookp through column and seperate values

    See attached... Main if before

    Other Tabs are after
    Attached Files Attached Files

  18. #18
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,523

    Re: macro to lookp through column and seperate values

    No need to prepare each worksheets before run the code.
    Please Login or Register  to view this content.
    Attached Files Attached Files

  19. #19
    Registered User
    Join Date
    06-08-2015
    Location
    United States
    MS-Off Ver
    2013
    Posts
    31

    Re: macro to lookp through column and seperate values

    Thank you.!
    Last edited by GuruIamnot; 11-09-2015 at 05:41 PM.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Combining Column Values if Seperate Column Values are Equal
    By Drew67209 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 12-18-2014, 11:01 AM
  2. Replies: 3
    Last Post: 09-10-2014, 09:39 PM
  3. [SOLVED] how to seperate values of each column from selection
    By amethystfeb in forum Excel - New Users/Basics
    Replies: 6
    Last Post: 07-22-2014, 06:22 AM
  4. Macro that will print each column starting with column B on a seperate page
    By awebzz in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 09-18-2013, 12:25 PM
  5. [SOLVED] Counting Multiple Values in a column based on critera in seperate column
    By ERoberts in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 04-11-2013, 01:08 PM
  6. Replies: 1
    Last Post: 06-30-2012, 01:45 PM
  7. Averaging values based on seperate column values
    By beng404 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 05-16-2011, 10:07 AM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1