+ Reply to Thread
Results 1 to 6 of 6

Group/Un-group Columns through buttons using VBA

  1. #1
    Registered User
    Join Date
    01-02-2014
    Location
    London, England
    MS-Off Ver
    Excel 2007
    Posts
    34

    Group/Un-group Columns through buttons using VBA

    Hi,

    I have grouped my columns from "D" to "U", but I want to control them through button. If you click BUTTON1 placed in column "C", it should group them if they are un-grouped, or un-group them if they are grouped.

    Can we control this through Macro. Below is link to the Excel file.

    https://www.dropbox.com/s/9sinkgpa21...mple.xlsm?dl=0

    Many Thanks

  2. #2
    Forum Expert
    Join Date
    10-09-2012
    Location
    Dallas, Texas
    MS-Off Ver
    MO 2010 & 2013
    Posts
    3,049

    Re: Group/Un-group Columns through buttons using VBA

    Please Login or Register  to view this content.
    Please ensure you mark your thread as Solved once it is. Click here to see how.
    If a post helps, please don't forget to add to our reputation by clicking the star icon in the bottom left-hand corner of a post.

  3. #3
    Registered User
    Join Date
    01-02-2014
    Location
    London, England
    MS-Off Ver
    Excel 2007
    Posts
    34

    Re: Group/Un-group Columns through buttons using VBA

    Thanks a million! This was quick and solved my problem. Thank you so so much.

    Just one more thing, I have got 3 images on first row, when my columns expand, the images also moves to very far end, is there anyway by which I can keep the images in center all the time? When grouped or un-grouped, they should maintain their center position?

    Many Thanks

  4. #4
    Forum Expert
    Join Date
    10-09-2012
    Location
    Dallas, Texas
    MS-Off Ver
    MO 2010 & 2013
    Posts
    3,049

    Re: Group/Un-group Columns through buttons using VBA

    You could set the image location with the VBA after grouping or ungrouping.
    Otherwise I dont deal with IMAGES much in Excel so I cant be of much use.

    You could probably record a macro and move them to a specific location and use that code to drop into the HideUnHide code.

  5. #5
    Registered User
    Join Date
    01-02-2014
    Location
    London, England
    MS-Off Ver
    Excel 2007
    Posts
    34

    Re: Group/Un-group Columns through buttons using VBA

    Do you have any idea or any syntax in mind which I can play with? I can change the positions if you can give me an example line of code with proper syntax, I probably could work around on it, if its easy for you.

    Thanks again.

  6. #6
    Forum Contributor
    Join Date
    04-06-2016
    Location
    Singapore
    MS-Off Ver
    MS Office 365 & 2010
    Posts
    698

    Re: Group/Un-group Columns through buttons using VBA

    How can I do this with Drop Down list in C column, Because I have 2 groups

    Please Login or Register  to view this content.

+ 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: 1
    Last Post: 02-03-2016, 06:43 PM
  2. Option Buttons: Selection in One Group Enables the Next Group
    By excelforumkeys in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-24-2014, 04:00 PM
  3. Replies: 1
    Last Post: 02-10-2014, 10:26 PM
  4. Replies: 2
    Last Post: 01-18-2013, 12:45 PM
  5. Group Box with Option Buttons
    By e4excel in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 12-01-2009, 02:05 AM
  6. [SOLVED] group option buttons
    By umba-sr in forum Excel General
    Replies: 1
    Last Post: 03-07-2006, 10:10 AM
  7. Group of Radio Buttons
    By sungen99 in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 02-17-2006, 01:15 PM

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