+ Reply to Thread
Results 1 to 10 of 10

Need help with 2 different macros - Rows and Columns

  1. #1
    Registered User
    Join Date
    02-19-2015
    Location
    USA
    MS-Off Ver
    2010, 2013
    Posts
    5

    Need help with 2 different macros - Rows and Columns

    I have a workbook with several macros and I am stumped on two specific macros and would like to ask for some help.

    First One:

    I want to Hide All of the Rows (22:236) that do NOT have any data in columns B thru M. I have the following set up and it works for column B (B22:B236), but if I set a Range (B22:M236), it hides all of my rows. FYI, I have multiple header rows...I tried to attach some screen shots in a word doc, but it would not allow me to...just kept spinning. Anyways, Here is what I have:

    Please Login or Register  to view this content.

    Second One:

    In the SAME workbook, I have several spreadsheets in which I want to hide the columns if the Data in a particular cell = 0. I have it working for one of the spreadsheets, just not sure how to make it happen on all at the same time. Here is what I have.

    Please Login or Register  to view this content.
    The spreadsheets that I would like to hide on one button click are:

    1. Operating Budget - Based on G3:M3 being 0
    2. Travel Budget Details - Based on H8:N8 being 0
    3. Total Operating Budget - Based on D4:J4 being 0
    Last edited by Dragct; 02-20-2015 at 03:45 PM.

  2. #2
    Forum Expert
    Join Date
    08-28-2014
    Location
    Texas, USA
    MS-Off Ver
    2016
    Posts
    1,796

    Re: Need help with 2 different macros - Rows and Columns

    Please put your code in code tags, so that it looks like my code below. Edit the post, highlight the code, then select the # button in the text editor.

    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    02-19-2015
    Location
    USA
    MS-Off Ver
    2010, 2013
    Posts
    5

    Re: Need help with 2 different macros - Rows and Columns

    Thank you for the quick response. I put my code in the code tags...did not know I should do that.

    The first one on Hiding Rows works perfectly. Thank you.

    On the second one, when I ran it, it hid All of the columns in the Operating Budget sheet and no columns in the other two sheets. Any thoughts?

    Thanks again! Kim

  4. #4
    Forum Expert
    Join Date
    08-28-2014
    Location
    Texas, USA
    MS-Off Ver
    2016
    Posts
    1,796

    Re: Need help with 2 different macros - Rows and Columns

    Hmm, might have to post the workbook.

    Double check that the worksheet names are correct (like there aren't any hidden spaces or anything in your tab names).

  5. #5
    Registered User
    Join Date
    02-19-2015
    Location
    USA
    MS-Off Ver
    2010, 2013
    Posts
    5

    Re: Need help with 2 different macros - Rows and Columns

    How do I post the workbook?

  6. #6
    Forum Expert
    Join Date
    08-28-2014
    Location
    Texas, USA
    MS-Off Ver
    2016
    Posts
    1,796

    Re: Need help with 2 different macros - Rows and Columns

    Click the Go Advanced button in the lower right of hte quick reply, you'll see an attachment button in the editor.

  7. #7
    Registered User
    Join Date
    02-19-2015
    Location
    USA
    MS-Off Ver
    2010, 2013
    Posts
    5

    Re: Need help with 2 different macros - Rows and Columns

    OP16 Budget Template 2015-02-12.xlsmMacro Screen Shots.docx

    Gotcha. Thanks...I am new to this forum. Hope this worked.

  8. #8
    Forum Expert
    Join Date
    08-28-2014
    Location
    Texas, USA
    MS-Off Ver
    2016
    Posts
    1,796

    Re: Need help with 2 different macros - Rows and Columns

    Oops. I forgot to reference the ranges on the specific sheets. Add "ws." to all the ranges, as shown below in the example:

    Please Login or Register  to view this content.

  9. #9
    Registered User
    Join Date
    02-19-2015
    Location
    USA
    MS-Off Ver
    2010, 2013
    Posts
    5

    Re: Need help with 2 different macros - Rows and Columns

    THANK YOU, THANK YOU, THANK YOU!!! I am so excited. I really appreciate your patience and your help with this. Have a wonderful weekend.

  10. #10
    Forum Expert
    Join Date
    08-28-2014
    Location
    Texas, USA
    MS-Off Ver
    2016
    Posts
    1,796

    Re: Need help with 2 different macros - Rows and Columns

    Great! Please mark this thread as SOLVED (instructions below), and any reputation points (the * in the lower left of my posts) is appreciated.
    • -Go to the top of the first post
    • -Select Thread Tools
    • -Select Mark thread as Solved

+ 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] vb macros code to convert rows into columns one after other
    By Dharani Suresh in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 08-11-2013, 05:30 AM
  2. [SOLVED] Macros for Moving Data from Columns to Rows
    By rrajnish in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 06-17-2013, 03:18 PM
  3. [SOLVED] Macros for Moving Data from Columns to Rows
    By rrajnish in forum Excel Programming / VBA / Macros
    Replies: 12
    Last Post: 06-17-2013, 03:15 PM
  4. Extended Range (Columns & Rows) in Macros
    By hardeep.kanwar in forum Excel General
    Replies: 0
    Last Post: 07-16-2009, 03:58 AM
  5. Macros deleting certain worksheets, columns and rows
    By Steezo in forum Excel General
    Replies: 0
    Last Post: 08-01-2005, 05:28 AM

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