+ Reply to Thread
Results 1 to 22 of 22

Need Macros or If/Then Statement To Match Data from one column into another Please

  1. #1
    Forum Contributor
    Join Date
    07-31-2014
    Location
    Texas
    MS-Off Ver
    Mac 2011 Version 14.5.4
    Posts
    114

    Need Macros or If/Then Statement To Match Data from one column into another Please

    Hi again everyone,
    I coded myself into a hole =( Can you please help?

    I have the following two files (see attachments):
    NBdataC needs column P filled in. It will be filled in using CGEvent column C. The reference columns are A & B in CGEvent that need to match B & F in NBDataC.

    This will get adjusted for my much larger original file with 75K rows.
    Thank you in advance!
    Attached Files Attached Files
    Last edited by MermaidNiki; 08-27-2017 at 10:13 AM.

  2. #2
    Forum Contributor
    Join Date
    07-31-2014
    Location
    Texas
    MS-Off Ver
    Mac 2011 Version 14.5.4
    Posts
    114

    Re: Need Macros or If/Then Statement To Match Data from one column into another Please

    Normally I get a super fast response. Can anyone please help? I really need to get this column recoded so I can finish up some GLMMs.
    Thank you!

  3. #3
    Forum Expert Sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,380

    Re: Need Macros or If/Then Statement To Match Data from one column into another Please

    I'm quite stumped as I can't seem to grasp the requirement....Perhaps trying a more elaborate explanation...
    Good Luck
    I don't presume to know what I am doing, however, just like you, I too started somewhere...
    One-day, One-problem at a time!!!
    If you feel I have helped, please click on the star to left of post [Add Reputation]
    Also....add a comment if you like!!!!
    And remember...Mark Thread as Solved.
    Excel Forum Rocks!!!

  4. #4
    Forum Contributor
    Join Date
    07-31-2014
    Location
    Texas
    MS-Off Ver
    Mac 2011 Version 14.5.4
    Posts
    114

    Re: Need Macros or If/Then Statement To Match Data from one column into another Please

    Oh I'm sorry! Let's see if I can elaborate.
    CGEvents has counts of events that happened each month to each group (R1, R2, PB). I need these moved over into the column P in NBdataC so that P2 will have the correct number based on it's B2 & F2. In this case, 12 (because in CGEvents, R2 in the month of Feb has 12 events occur). This row happens to be correct only by sheer luck. I think all of Feb data may be correct for all groups, but the subsequent months are wrong. And while this NBdataC file only has a few of the months I need (due to file size constraints), the full data file will have all 11 months. So any code would be adapted to apply to all 11 months.

    I have the exact same data in two forms in CGEvents because of a prior data need. I left both because I wasn't sure which would be easier to utilize to get the needed data pulled over. Does this help?

  5. #5
    Forum Expert Sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,380

    Re: Need Macros or If/Then Statement To Match Data from one column into another Please

    Thanks for that MermaidNiki...
    Last question....Are the months in the two sheets having the same amount of rows....

    Nevermind...Had a blonde moment.. The events are found in E3:H13...correct
    Last edited by Sintek; 08-27-2017 at 10:48 AM.

  6. #6
    Forum Contributor
    Join Date
    07-31-2014
    Location
    Texas
    MS-Off Ver
    Mac 2011 Version 14.5.4
    Posts
    114

    Re: Need Macros or If/Then Statement To Match Data from one column into another Please

    No they don't anymore. They did with the original data file but that was several files ago and I have since changed them up. (Honestly, I don't know why I setup CGEvents columns BC the way I did - it just wound up causing more problems - but this is all a learning process i suppose).

  7. #7
    Forum Expert Sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,380

    Re: Need Macros or If/Then Statement To Match Data from one column into another Please

    The events are found in E3:H13...correct
    Are the events found in this range...Can i use this in the code....On CGEvent...
    Also is this the actual look of the files...

  8. #8
    Forum Contributor
    Join Date
    07-31-2014
    Location
    Texas
    MS-Off Ver
    Mac 2011 Version 14.5.4
    Posts
    114

    Re: Need Macros or If/Then Statement To Match Data from one column into another Please

    Hi,
    Yes the data in E3-H13 is the same as columns ABC, if it is easier, you can use those.

    The CGEvents file is only a reference file, it will not be used in data analysis. NBdataC is what the data file will look like, but I had to delete about 40 columns and 20k rows in order to make it small enough to upload here. When people help me out on here I take the code and adapt it to the full data file.
    Does this help?
    Thank you!!

  9. #9
    Forum Expert Sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,380

    Re: Need Macros or If/Then Statement To Match Data from one column into another Please

    Give this a go. Tests fine. Both workbooks to be open.
    Code is housed in NBDataC
    Please Login or Register  to view this content.

  10. #10
    Forum Contributor
    Join Date
    07-31-2014
    Location
    Texas
    MS-Off Ver
    Mac 2011 Version 14.5.4
    Posts
    114

    Re: Need Macros or If/Then Statement To Match Data from one column into another Please

    Thank you! I am getting an error though:
    Error: Run-time error ’429’ ActiveX component can’t create object

    On line:
    Set Arr = CreateObject("System.Collections.ArrayList")

    I forgot to mention that I am a Mac user - I feel like I have seen this error before. =(
    I need to add this into my signature so I stop forgetting to add it in. I'm sorry, is it possible to fix it?

  11. #11
    Forum Expert Sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,380

    Re: Need Macros or If/Then Statement To Match Data from one column into another Please

    Not familiar with mac code conversion I'm afraid....Perhaps someone else can convert code...
    At least i know it tests fine on Windows Operating...

    Macros do indeed work properly in Excel 2011 for Mac. The problem is that the Macintosh does not support Active-X. This is an Apple issue, not Excel or Microsoft's. You will have to revise your application so that it does not use Active-X controls and then it will work properly on both platforms.
    https://answers.microsoft.com/en-us/...d-ed82536e8a76
    Last edited by Sintek; 08-27-2017 at 01:04 PM.

  12. #12
    Forum Contributor
    Join Date
    07-31-2014
    Location
    Texas
    MS-Off Ver
    Mac 2011 Version 14.5.4
    Posts
    114

    Re: Need Macros or If/Then Statement To Match Data from one column into another Please

    I completely understand! Thank you! I wonder if I should create a new thread or if someone will see this?

  13. #13
    Forum Expert Sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,380

    Re: Need Macros or If/Then Statement To Match Data from one column into another Please

    If you like....Remember to post the link to this thread....
    Use this as subject header..."Run-time error ’429’ ActiveX component can’t create object Windows vs Mac"

    Lots of issues like this already in google....
    https://www.excelforum.com/excel-pro...te-object.html
    Last edited by Sintek; 08-27-2017 at 01:11 PM.

  14. #14
    Forum Contributor
    Join Date
    07-31-2014
    Location
    Texas
    MS-Off Ver
    Mac 2011 Version 14.5.4
    Posts
    114

    Re: Need Macros or If/Then Statement To Match Data from one column into another Please

    Quote Originally Posted by sintek View Post
    if you like....remember to post the link to this thread....
    Use this as subject header..."run-time error ’429’ activex component can’t create object windows vs mac"
    thank you!

  15. #15
    Forum Expert Sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,380

    Re: Need Macros or If/Then Statement To Match Data from one column into another Please

    Try this conversion...
    Please Login or Register  to view this content.

  16. #16
    Forum Contributor
    Join Date
    07-31-2014
    Location
    Texas
    MS-Off Ver
    Mac 2011 Version 14.5.4
    Posts
    114

    Re: Need Macros or If/Then Statement To Match Data from one column into another Please

    Quote Originally Posted by sintek View Post
    Try this conversion...
    Please Login or Register  to view this content.
    Oh my gosh that worked! Thank you sintek!!

  17. #17
    Forum Expert Sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,380

    Re: Need Macros or If/Then Statement To Match Data from one column into another Please

    Pleasure...And so I too learn lol....

  18. #18
    Forum Contributor
    Join Date
    07-31-2014
    Location
    Texas
    MS-Off Ver
    Mac 2011 Version 14.5.4
    Posts
    114

    Re: Need Macros or If/Then Statement To Match Data from one column into another Please

    Quote Originally Posted by sintek View Post
    Try this conversion...
    Please Login or Register  to view this content.
    And I just tested it on the big file - I got it to work perfectly. Thank you for saving me days of hand coding! I wish I could rate you twice!

  19. #19
    Forum Expert Sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,380

    Re: Need Macros or If/Then Statement To Match Data from one column into another Please

    It's the thought that counts

  20. #20
    Registered User
    Join Date
    12-25-2019
    Location
    Germany
    MS-Off Ver
    16.32
    Posts
    2

    Re: Need Macros or If/Then Statement To Match Data from one column into another Please

    Any chance someone would be able to "convert" this for Mac compatibility for me? :D

    Sub FolderSize()
    Dim fso As Object, fsoFolder As Object
    Const strFolderName As String = "PathName"

    Set fso = CreateObject("Scripting.FileSystemObject")
    Set fsoFolder = fso.GetFolder(strFolderName)

    MsgBox fsoFolder.Size & " bytes"

    Set fsoFolder = Nothing
    Set fso = Nothing

    End Sub


    Works fine on Windows, but the Set fso = CreateObject("Scripting.FileSystemObject") spits out the Error: Run-time error ’429’ ActiveX component can’t create object

  21. #21
    Forum Expert Sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,380

    Re: Need Macros or If/Then Statement To Match Data from one column into another Please

    Hi fizpop

    I suggest you have a look here at our Forum riles as you are breaking so so many of them...

    Start by "Starting" your own thread...

  22. #22
    Registered User
    Join Date
    12-25-2019
    Location
    Germany
    MS-Off Ver
    16.32
    Posts
    2

    Re: Need Macros or If/Then Statement To Match Data from one column into another Please

    I apologize, please ignore my post then

+ 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. [SOLVED] Match and consolidate data from two different sheets into a 3rd one problem. (VBA, Macros)
    By PaulAllen in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 01-23-2017, 12:39 AM
  2. Match columns A & C and partial Match B & D and get column E data
    By Excelbanksters in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 10-26-2016, 04:05 PM
  3. VBA Macros Userform checkbox to copy data with condition match
    By hecgroups in forum Excel Programming / VBA / Macros
    Replies: 13
    Last Post: 01-22-2016, 11:55 AM
  4. Replies: 6
    Last Post: 09-03-2015, 09:51 PM
  5. [SOLVED] Two Excel sheets trying to match text data and return the match from the second column!
    By bankcott in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 02-02-2013, 02:17 PM
  6. Match inputs in one column with data from another if >50% of their consec letters match
    By TaskinRahman in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 12-24-2012, 01:47 AM
  7. Replies: 6
    Last Post: 12-10-2012, 06:26 PM

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