+ Reply to Thread
Results 1 to 9 of 9

UserForm Idea Needed For Matching Columns and Changing Headers

  1. #1
    Registered User
    Join Date
    04-23-2013
    Location
    Jensen Beach, FL
    MS-Off Ver
    Excel 2016
    Posts
    41

    UserForm Idea Needed For Matching Columns and Changing Headers

    Hi! I'd like to create a User Form that will change my column headers to be what I need for upload into my database. I'd like the User Form to show me what the header currently is, and then allow me to choose from a list what the upload header should be, and then have a macro replace the original header with the one I chose from the list. Before I went too far, I wanted to see if anyone had any ideas about the cleanest/best way to accomplish this. The original data column headers will be different every time, so I can't simply write something to look for this and change it to that. The user will need to say "this column contains this data". And there could be anywhere from 5 to 50 columns of data on the spreadsheet.

    Any ideas on the best way to accomplish this? My current thought is with two comboboxes one that is populated with the range of row 1 so it shows you all of the original headers, and then the second one with all the proper upload headers to choose from. It seems like there is probably a slicker way to do this and I am hoping someone will have a better idea.

    Thanks in advance!
    Spacle
    Last edited by spacle; 09-30-2020 at 02:40 PM.

  2. #2
    Banned User!
    Join Date
    02-06-2020
    Location
    Iowa City, IA, USA
    MS-Off Ver
    2016 - 365 / 2007
    Posts
    2,014

    Re: UserForm Idea Needed For Matching Columns and Changing Headers

    a dropdown in a userform is a combo box. and we assume by the term header, you mean the text located in the top row of the sheet you are targeting? if that is so, here's how you reference a combo box on a form. in this example, the name of the form is userform1 and the name of the dropdown is combo1:
    Please Login or Register  to view this content.
    you reference a range (single cell) in one of two ways that I know of:
    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    04-23-2013
    Location
    Jensen Beach, FL
    MS-Off Ver
    Excel 2016
    Posts
    41

    Re: UserForm Idea Needed For Matching Columns and Changing Headers

    Hi, vba_php! Thanks for responding! I'm afraid I wasn't being clear enough in my question. I know how to set up the VBA to have combobox1 populate automatically with the values from Row 1, and how to have another combobox2 that has the possible matches in it (ex. their choice in combobox1 sets the active cell, their choice in combobox2 sets the text that replaces the original data in the active cell with what it needs to be for upload when they click on command button1). My question was, is there a cooler way to do that than just 2 comboboxes and a command button?

    Thanks again!
    Spacle

  4. #4
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,080

    Re: UserForm Idea Needed For Matching Columns and Changing Headers

    Personally I would go with a couple of listboxes & a command button.
    Select an item in list1, then the correct header from list2, run a click event on list 2 to add the correct header into an array & then the command button would put the array onto the sheet.

  5. #5
    Banned User!
    Join Date
    02-06-2020
    Location
    Iowa City, IA, USA
    MS-Off Ver
    2016 - 365 / 2007
    Posts
    2,014

    Re: UserForm Idea Needed For Matching Columns and Changing Headers

    Spacle,

    If I were you I wouldn't worry at all about the coolness of your application and its looks. if you work in any sort of organization whether it be a large corporation or a small one or even a proprietary business that is not incorporated, the purpose is profit and revenue generation the purpose is not to look cool at least it isn't in this town that I live in. most of the cool stuff that sells is the crap that comes out of California like mobile apps and things that are marketed to college kids and kids younger than that age. As far as I've seen coolness isn't affecting older people like in their 40s and above but I could be wrong. Because because they're obviously has been a trend for a few years now whereby the coolness of anything sells massively so everybody of course jumps on the bandwagon.personally I think that trend is happening because that's the only thing that's left that sells anything else is boring as hell and people aren't buying it lol.

    Fluff,

    Nice suggestion and of course that's an alternative way to do it but I don't really think the person asking this question may understand that without further clarification or more questions being asked because it's a lot more complicated than what he's trying to do now.

  6. #6
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,080

    Re: UserForm Idea Needed For Matching Columns and Changing Headers

    I don't really think the person asking this question may understand that without further clarification
    No, but then (IMO) you have always treated other people as idiots.
    The OP was asking for ideas & that is what I supplied. If he/she wants further help with it, they can simply ask.

  7. #7
    Banned User!
    Join Date
    02-06-2020
    Location
    Iowa City, IA, USA
    MS-Off Ver
    2016 - 365 / 2007
    Posts
    2,014

    Re: UserForm Idea Needed For Matching Columns and Changing Headers

    Quote Originally Posted by Fluff13 View Post
    No, but then (IMO) you have always treated other people as idiots.
    just because I might have made a mistake ONE TIME on another board and you witnessed it, Fluff, I think that statement of yours is completely off base at this point in time my man. If you think I like to put others down, can you tell me why I have 5 official students in various countries of the world, some paying me and some not, to teach them a few different languages, Python included? Why would anyone want to learn from an egotistical jerk like me!? I think what your error is here is that, instead of looking at me as someone with a high level of intellect that likes to issue explanations that are way over peoples' heads, you could look at me as someone who seriously injects inspiration, encouragement, mysteriousness and desire to learn in others.

    It's your choice as to how you want to look at me. My way is just like everyone else's. some like it some don't.

  8. #8
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,080

    Re: UserForm Idea Needed For Matching Columns and Changing Headers

    an egotistical jerk like me
    You said it not me, but if the shoe fits...
    Now lets keep this on track & not hijack the thread.

  9. #9
    Banned User!
    Join Date
    02-06-2020
    Location
    Iowa City, IA, USA
    MS-Off Ver
    2016 - 365 / 2007
    Posts
    2,014

    Re: UserForm Idea Needed For Matching Columns and Changing Headers

    Good call. By the way I spoke to John Hayden through LinkedIn and he told me that there's a possibility The forum moderators would let me back in if I made a request. However I have no desire to do so.

+ 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. Replies: 14
    Last Post: 08-04-2020, 12:06 PM
  2. [SOLVED] Idea needed for Car tracking table
    By jp16 in forum Excel General
    Replies: 2
    Last Post: 11-23-2017, 06:36 AM
  3. Allocation of columns to other sheet based on matching headers
    By etaver87 in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 05-24-2016, 09:44 AM
  4. Allocation of columns to other sheet based on matching headers
    By etaver87 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-24-2016, 09:41 AM
  5. Replies: 4
    Last Post: 02-08-2014, 02:31 PM
  6. VBA macro needed to delete duplicate entries matching across multiple columns
    By chicolocal in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-01-2012, 02:34 PM
  7. Auto filter multiple columns matching with searched headers
    By gotovamsee in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-08-2011, 03:20 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