+ Reply to Thread
Results 1 to 14 of 14

VBA - Help creating a Macro for a button

  1. #1
    Registered User
    Join Date
    06-07-2012
    Location
    San Francisco
    MS-Off Ver
    Excel 2010
    Posts
    18

    VBA - Help creating a Macro for a button

    *File attached for reference

    I am trying to write a large macro associated with the button on 'Sheet2'. First i need to identify the country that i select in the drop down as my 'index'. i am having trouble getting that to happen.

    Then, after i define the country, i will then need to have the fields populated below with the information in the Data Field. The catch is that the amount of fields needed may vary from all 5, to only 1. I can use a "hide" function if needed, but was wondering if there was a better way.

    Data for Drop down:

    Please Login or Register  to view this content.
    Attached Files Attached Files
    Last edited by arlu1201; 07-27-2012 at 07:42 AM.

  2. #2
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: VBA - Help creating a Macro for a button

    Jukeboxhero,

    Welcome to the forum.

    I have added code tags to your post. As per forum rule 3, you need to use them whenever you put any code in your post. Please add them in future. If you need more information on how to use them, check my signature.

    ---------- Post added at 05:13 PM ---------- Previous post was at 05:12 PM ----------

    Any reason why you are doing it with VBA? You can do this with formulae as well.
    If I have helped, Don't forget to add to my reputation (click on the star below the post)
    Don't forget to mark threads as "Solved" (Thread Tools->Mark thread as Solved)
    Use code tags when posting your VBA code: [code] Your code here [/code]

  3. #3
    Registered User
    Join Date
    06-07-2012
    Location
    San Francisco
    MS-Off Ver
    Excel 2010
    Posts
    18

    Re: VBA - Help creating a Macro for a button

    This is just a test sheet. There is a much larger one im working with that has many reference tabs and fields. Plus, by selecting the country form the drop down, it will have some dynamic function when building in the data to the referenced ares in the bulk of the sheet.

    does this make sense. if not, please let me know. im still new to this.

  4. #4
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: VBA - Help creating a Macro for a button

    Cross posted here
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

  5. #5
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: VBA - Help creating a Macro for a button

    Jukeboxhero,

    I'm afraid your post does not comply with Rule 8 of our Forum RULES. Cross-posting is when you post the same question in other forums on the web. You'll find people are disinclined to respond to cross-posts because they may be wasting their time solving a problem that has been solved elsewhere. We prefer that you not cross-post at all, but if you do (and it's unlikely to go unnoticed), you MUST provide a link (copy the url from the address bar in your browser)to the cross-post. Expect cross-posts without a link to be closed a message will be posted by the moderator explaining why. We are here to help so help us to help you!

    Read this to understand why we ask you to do this, and then please edit your first post to include links to any and all cross-posts in any other forums (not just this site).

  6. #6
    Registered User
    Join Date
    06-07-2012
    Location
    San Francisco
    MS-Off Ver
    Excel 2010
    Posts
    18

    Re: VBA - Help creating a Macro for a button

    http://www.ozgrid.com/forum/showthre...515#post620515

    Deleted. Sorry, didnt realize i was cross posting. but it has been deleted. sorry.

  7. #7
    Registered User
    Join Date
    06-07-2012
    Location
    San Francisco
    MS-Off Ver
    Excel 2010
    Posts
    18

    Re: VBA - Help creating a Macro for a button

    Does this mean that this thread has been removed? or is it still posted in hopes that someone can help?

  8. #8
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: VBA - Help creating a Macro for a button

    No, your thread is still here.

  9. #9
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: VBA - Help creating a Macro for a button

    As is the one at Ozgrid. Basically, it's OK to cross post but have the courtesy to let us know with a simple link.

  10. #10
    Registered User
    Join Date
    06-07-2012
    Location
    San Francisco
    MS-Off Ver
    Excel 2010
    Posts
    18

    Re: VBA - Help creating a Macro for a button

    lesson definitely learned. thank you. any ideas on how to help me with this issue?

  11. #11
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: VBA - Help creating a Macro for a button

    I can't make any sense of what you are asking. Do you want to show say only Belgium in the data sheet, what goes into the first sheet with the combobox?

  12. #12
    Registered User
    Join Date
    06-07-2012
    Location
    San Francisco
    MS-Off Ver
    Excel 2010
    Posts
    18

    Re: VBA - Help creating a Macro for a button

    what i need is to select one of the countries in the drop down, and have it fill the necessary fields in the sections below. But, the # of sections will vary. For example, Belgium has 3 possible fills, while Japan only has 1. So based on the country i select, the number of rows used varies. i have re-attached the sheet with 2 "Example" tabs so you can see this.

    im trying to learn 2 things here:

    1) How to define my country as the "index" in VBA.
    2) Then i want to learn how to get VBA to pull the dynamic data i need. What lines do i need to write in VBA to accomplish this?

    Thanks again for taking the time to help me with this. If you are ever in San Francisco i will buy beers for the help.

  13. #13
    Registered User
    Join Date
    06-07-2012
    Location
    San Francisco
    MS-Off Ver
    Excel 2010
    Posts
    18

    Re: VBA - Help creating a Macro for a button

    forgot attachment
    Attached Files Attached Files
    Last edited by JukeBoxHero; 07-30-2012 at 09:28 AM.

  14. #14
    Registered User
    Join Date
    06-07-2012
    Location
    San Francisco
    MS-Off Ver
    Excel 2010
    Posts
    18

    Re: VBA - Help creating a Macro for a button (CLOSED)

    Found solution

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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