+ Reply to Thread
Results 1 to 6 of 6

Copy table column "and" macro button over to right with each push of macro button

  1. #1
    Forum Contributor
    Join Date
    03-21-2013
    Location
    USA
    MS-Off Ver
    365
    Posts
    163

    Copy table column "and" macro button over to right with each push of macro button

    I have a button with a macro assigned to it that is supposed to copy a table column range below the button location, over to the right, then go back and copy the macro button from the previous left column and paste it over the newly created column to the right. This appears to be working correctly, but only for the first two columns.

    I've attached the excel file here for reference. Press the "+" button above the first table column to see the what is supposed to occur every time that button is pushed.

    If somebody could take a look at this code and see if I'm doing something wrong, that would be awesome. As far as I can tell, everything looks correct. I can't figure out where the error is though.

    Thanks,
    Mike in Cali
    Attached Files Attached Files

  2. #2
    Forum Expert Logit's Avatar
    Join Date
    12-23-2012
    Location
    North Carolina
    MS-Off Ver
    Excel 2019 Professional Plus - 2007 Enterprise
    Posts
    7,014

    Re: Copy table column "and" macro button over to right with each push of macro button

    .
    Not certain I understand what your goal is ... but ... I edited the macro ProjectDataBtns / these two lines :

    Please Login or Register  to view this content.
    Note it now says "ShowAutoFilter" ... not ... "ShowAutoFilterDropDowns"

  3. #3
    Forum Contributor
    Join Date
    03-21-2013
    Location
    USA
    MS-Off Ver
    365
    Posts
    163

    Re: Copy table column "and" macro button over to right with each push of macro button

    Thanks for the reply Logit, but the table column and the buttons above, still wont copy over to the right, past more than 1 column. I need that "+" button to copy the column below, over to the right, and then also copy the macro buttons above it, over to the right as well. This should happen for as many columns as I press the button. The weird thing is that this was working just fine before. I can't figure out what I've done to mess this up.

  4. #4
    Forum Contributor
    Join Date
    03-21-2013
    Location
    USA
    MS-Off Ver
    365
    Posts
    163

    Re: Copy table column "and" macro button over to right with each push of macro button

    I decided to add
    Please Login or Register  to view this content.
    to the end of my CopyColRngaPasteNextCol Sub, and it seems to have fixed everything. Weird.

  5. #5
    Forum Expert Logit's Avatar
    Join Date
    12-23-2012
    Location
    North Carolina
    MS-Off Ver
    Excel 2019 Professional Plus - 2007 Enterprise
    Posts
    7,014

    Re: Copy table column "and" macro button over to right with each push of macro button

    That is very strange as it doesn't directly affect the copy/paste code. I'm out and about at the moment. Will see how it affects the code here when I return.

  6. #6
    Forum Expert Logit's Avatar
    Join Date
    12-23-2012
    Location
    North Carolina
    MS-Off Ver
    Excel 2019 Professional Plus - 2007 Enterprise
    Posts
    7,014

    Re: Copy table column "and" macro button over to right with each push of macro button

    .
    Ran it through here and it works as well as it does for you. Strange.

    One thing I noticed is the second row number is increasing with each paste by adding another "2" to the string. So it is creating A1-2, A1-22, A1222 etc. etc.

    I added one line to your macro to correct that :

    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. [SOLVED] Trying to add a macro to activate another macro to "click" a command button to clear cells
    By nthpl888 in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 05-13-2016, 02:52 PM
  2. Using a macro on workbook1 to create a button in wb2 and assigning macro "wb2!macro"
    By penfold1992 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 08-13-2014, 11:39 AM
  3. Adding "Command Button" and "Messages Box" in VBA Macro
    By sanjeevkumarmc in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 02-09-2014, 07:21 AM
  4. Macro to copy cells from workbook,where column C is = "num1" AND Column D ="num2"
    By jarious87 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 12-10-2013, 03:30 PM
  5. [SOLVED] "Are you sure you meant to push the form button?" option, such a thing?
    By Butcher1 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-03-2013, 10:46 PM
  6. Replies: 1
    Last Post: 02-27-2012, 09:00 AM
  7. Replies: 1
    Last Post: 05-30-2006, 04:10 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