+ Reply to Thread
Results 1 to 9 of 9

Creat a Macro to hide a row if column C contains "Not Used"

  1. #1
    Forum Contributor
    Join Date
    10-03-2012
    Location
    USA
    MS-Off Ver
    Excel 2007
    Posts
    134

    Creat a Macro to hide a row if column C contains "Not Used"

    How to create a macro to hide entire rows if column c from 38:95 state "Not Used". Hopefully it won' tbe a problem that columns c through j at merged. Thanks!

  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: Creat a Macro to hide a row if column C contains "Not Used"

    Is the end row 95 always 95 or likely to change? Do you want the macro to be flexible to consider any number of rows?
    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
    Forum Contributor
    Join Date
    10-03-2012
    Location
    USA
    MS-Off Ver
    Excel 2007
    Posts
    134

    Re: Creat a Macro to hide a row if column C contains "Not Used"

    It should at this time always be 95 or 96. I would like for it to consider all the rows. Right now just looking at the worksheet briedly, I have 4 rows that I can see on my screen and I know there are more. Thanks!

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

    Re: Creat a Macro to hide a row if column C contains "Not Used"

    Try this code
    Please Login or Register  to view this content.
    Copy the Excel VBA code
    Select the workbook in which you want to store the Excel VBA code
    Hold the Alt key, and press the F11 key, to open the Visual Basic Editor
    Choose Insert | Module
    Where the cursor is flashing, choose Edit | Paste

    To run the Excel VBA code:
    Choose View | Macros
    Select a macro in the list, and click the Run button

  5. #5
    Forum Contributor
    Join Date
    10-03-2012
    Location
    USA
    MS-Off Ver
    Excel 2007
    Posts
    134

    Re: Creat a Macro to hide a row if column C contains "Not Used"

    Awesome. That is great. Am I able to just replace the word "Not Used" with 0 and change the name of the macro and the range from c to a and hide all the cells from a38 to a95. This will hide all rows if they contain zero in column A? Thanks again for your help.

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

    Re: Creat a Macro to hide a row if column C contains "Not Used"

    Yes, you do not need to change the name of the macro, if you want to for your own reference, you can do it, but it wont affect the running of the macro.

  7. #7
    Forum Contributor
    Join Date
    10-03-2012
    Location
    USA
    MS-Off Ver
    Excel 2007
    Posts
    134

    Re: Creat a Macro to hide a row if column C contains "Not Used"

    Awesome. Thank you so much. I am very new to Macros and I am learning very slowly. Thank you so much! :-)

  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: Creat a Macro to hide a row if column C contains "Not Used"

    Based on your last post in this thread, its apparent that you are satisfied with the solution(s) you've received and have solved your question, but you haven't marked your thread as "SOLVED". I will do it for you this time.

    In future, to mark your thread as Solved, you can do the following -
    Select Thread Tools-> Mark thread as Solved.

    Incase your issue is not solved, you can undo it as follows -
    Select Thread Tools-> Mark thread as Unsolved.

    Also, since you are relatively new to the forum, i would like to inform you that you can thank those who have helped you by clicking the small star icon located in the lower left corner of the post which helped you. This adds to the reputation of the person who has taken the time to help you.

  9. #9
    Forum Contributor
    Join Date
    10-03-2012
    Location
    USA
    MS-Off Ver
    Excel 2007
    Posts
    134

    Re: Creat a Macro to hide a row if column C contains "Not Used"

    Sorry, I went to lunch and just got back. I will go in and do everything. Thanks!

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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