View Poll Results: Does it Work?

Voters
0. This poll is closed
  • Efficiently

    0 0%
  • Accurately

    0 0%
  • Short Code

    0 0%
+ Reply to Thread
Results 1 to 9 of 9

Code to Insert Column causes Macro to not function correctly...

  1. #1
    Registered User
    Join Date
    01-27-2012
    Location
    Phoenix, Arizona
    MS-Off Ver
    Excel 2010
    Posts
    6

    Question Code to Insert Column causes Macro to not function correctly...

    Trying to create a macro to delete rows based on contents of a column, complete a few sorts, add a column and then combine contents of 3 columns into 1 for each row respectively and then subtotal based on the new combined column.

    Here is what I have that works but once I try to add column, macro does not complete the sorts at all or incorrectly depending on where the code for the insertion is placed and the code is edited based on placement of the code to insert the column.

    Please Login or Register  to view this content.
    Insertion Code...

    Please Login or Register  to view this content.
    Also can not get the concatenate or =D1&" "&E1&" "&F1 to fill the new C column...the formula works for the first cell and looks correct, meaning row number within formula changes, for the next cells but the outcome is the value of the first cell C1...

    Help???
    Last edited by numbersbuff; 01-27-2012 at 04:20 PM. Reason: Code Tags

  2. #2
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2010, 2019
    Posts
    40,689

    Re: Code to Insert Column causes Macro to not function correctly...

    Welcome to the forum, numbersbuff.

    Please take a few minutes to read the forum rules, and then edit your post to add CODE tags.

    Thanks
    Entia non sunt multiplicanda sine necessitate

  3. #3
    Registered User
    Join Date
    01-27-2012
    Location
    Phoenix, Arizona
    MS-Off Ver
    Excel 2010
    Posts
    6

    Re: Code to Insert Column causes Macro to not function correctly...

    Sorry first time on the forum and first time building Macro so if you could please explain CODE tags that would be helpful...

  4. #4
    Forum Expert Pepe Le Mokko's Avatar
    Join Date
    05-14-2009
    Location
    Belgium
    MS-Off Ver
    O365 v 2402
    Posts
    13,603

    Re: Code to Insert Column causes Macro to not function correctly...

    Hi
    Click on the forum rules button it's all explained there

  5. #5
    Registered User
    Join Date
    01-27-2012
    Location
    Phoenix, Arizona
    MS-Off Ver
    Excel 2010
    Posts
    6

    Re: Code to Insert Column causes Macro to not function correctly...

    Thank you!

  6. #6
    Registered User
    Join Date
    08-25-2011
    Location
    Dallas, TX
    MS-Off Ver
    Excel 2003
    Posts
    13

    Re: Code to Insert Column causes Macro to not function correctly...

    I'm not 100% sure what you're asking, can you post an example of what you have pre-macro and then the desired results?

    One thing to remember is that when deleting columns, you always want to go right to left since if you delete Column C, Column D will become Column C.

  7. #7
    Registered User
    Join Date
    01-27-2012
    Location
    Phoenix, Arizona
    MS-Off Ver
    Excel 2010
    Posts
    6

    Re: Code to Insert Column causes Macro to not function correctly...

    Thanks for the tip on deleting columns, after I get the afore mentioned portions to work that is the next step.

    Will post an example Monday but here is an over view:

    Inventory Sheet has Columns A:J, and a variable number of rows up too 1000. Each row can have items in each column cell or only some.

    First portion of Macro deletes any rows that lack data in F (quantity of item), the macro then sorts by first C (name of item), then D (size of item) and then E (color of item).

    The macro works to here. I need to then insert a column at C and then combine info from now D,E and F in to C, then delete or hide D,E and F and create subtotals by the new C.

    I will post a before and after on Monday...gotta run have a wonderful weekend!
    Last edited by numbersbuff; 01-27-2012 at 05:00 PM. Reason: grammar

  8. #8
    Registered User
    Join Date
    01-27-2012
    Location
    Phoenix, Arizona
    MS-Off Ver
    Excel 2010
    Posts
    6

    Question Re: Code to Insert Column causes Macro to not function correctly...

    Quote Originally Posted by jstephens View Post
    I'm not 100% sure what you're asking, can you post an example of what you have pre-macro and then the desired results?

    One thing to remember is that when deleting columns, you always want to go right to left since if you delete Column C, Column D will become Column C.
    I am sorry for the dely in this post. I did get the macro to work however I have to run each step separately for it to run correctly....maybe you can shed some light on the glitch??

    Please Login or Register  to view this content.

  9. #9
    Registered User
    Join Date
    01-27-2012
    Location
    Phoenix, Arizona
    MS-Off Ver
    Excel 2010
    Posts
    6

    Re: Code to Insert Column causes Macro to not function correctly...

    Here is an example of the sheet prior to the macro...
    Attached Files Attached Files

+ 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