+ Reply to Thread
Results 1 to 20 of 20

Hide specific Rows in Sheet1 + hide 5 more in Sheet2

  1. #1
    Registered User
    Join Date
    05-16-2014
    Location
    Germany
    MS-Off Ver
    Excel 2010
    Posts
    78

    Hide specific Rows in Sheet1 + hide 5 more in Sheet2

    hi,

    i need your help please. I have a macro in which i can enter the rows i want to hide.

    If i want to hide "position 32" i have to enter the number 8 of the row.
    This works fine. But now if i want to hide the "position 32" from Sheet1
    it also should hide the rows 4-8 from Sheet2 [Data with 32].

    Or if i hide "position 34" in Sheet1 [row 10] it also should hide the rows 14-18 in Sheet2.

    How is this possible?
    Thank you

    File is in the attachement
    Book1.xlsm

  2. #2
    Forum Expert
    Join Date
    07-15-2012
    Location
    Leghorn, Italy
    MS-Off Ver
    Excel 2010
    Posts
    3,431

    Re: Hide specific Rows in Sheet1 + hide 5 more in Sheet2

    why do you want enter the rows numbers and not the value you have to hide ?
    see attached
    Attached Files Attached Files
    Last edited by patel45; 05-26-2014 at 07:14 AM.
    If solved remember to mark Thread as solved

  3. #3
    Registered User
    Join Date
    09-04-2012
    Location
    Singapore
    MS-Off Ver
    Excel 2010
    Posts
    9

    Re: Hide specific Rows in Sheet1 + hide 5 more in Sheet2

    try adding this for all your respective rows.

    Range("A" & row1 * 4 - 3 & ": A" & row1 * 4).Select
    Selection.EntireRow.Hidden = True

  4. #4
    Registered User
    Join Date
    05-16-2014
    Location
    Germany
    MS-Off Ver
    Excel 2010
    Posts
    78

    Re: Hide specific Rows in Sheet1 + hide 5 more in Sheet2

    hi Poorcloud.

    This doesn't work. Sorry

  5. #5
    Registered User
    Join Date
    05-16-2014
    Location
    Germany
    MS-Off Ver
    Excel 2010
    Posts
    78

    Re: Hide specific Rows in Sheet1 + hide 5 more in Sheet2

    the select of the Position in Sheet1 is already working fine.

    But i need a solution for the Sheet2. if i choose 32 on Sheet1 it also should hide all rows with 32.* in Sheet2

  6. #6
    Forum Expert
    Join Date
    07-15-2012
    Location
    Leghorn, Italy
    MS-Off Ver
    Excel 2010
    Posts
    3,431

    Re: Hide specific Rows in Sheet1 + hide 5 more in Sheet2

    You can replicate the code for sheet2
    Please Login or Register  to view this content.

  7. #7
    Registered User
    Join Date
    05-16-2014
    Location
    Germany
    MS-Off Ver
    Excel 2010
    Posts
    78

    Re: Hide specific Rows in Sheet1 + hide 5 more in Sheet2

    Hi Patel45,

    But so i need two button ?
    I will only press one button and select the position "32" and position "34" for example in Sheet1.
    The macro should automatic search Sheet2 for all position "32" data [32.1,32.2,....] and "34" data [34.1,....].
    These rows should be hide automatic.

    Is this possible?

    sometimes there is a name instead of the number [ "test" (Sheet1) and "test.1" (Sheet2) instead of "32" (Sheet1) and "32.1" (Sheet2)for example]

    Do you know what i mean?

  8. #8
    Forum Expert
    Join Date
    07-15-2012
    Location
    Leghorn, Italy
    MS-Off Ver
    Excel 2010
    Posts
    3,431

    Re: Hide specific Rows in Sheet1 + hide 5 more in Sheet2

    All is possible, now you know how to solve for one sheet, you can develope the code

  9. #9
    Registered User
    Join Date
    05-16-2014
    Location
    Germany
    MS-Off Ver
    Excel 2010
    Posts
    78

    Re: Hide specific Rows in Sheet1 + hide 5 more in Sheet2

    Hy Patel,

    but i allready have the Code for the Sheet1 in the file?
    With the inputbox. This is really fine and the way how it should work.
    But if I Enter for example row 5 [Sheet1] it also should hide the Rows in Sheet2 with the same numerber.

    Sheet1 = 32
    Sheet2 = 31.1, 32.2, ......

    Do you konow what i mean?

    Thank you for your help

  10. #10
    Forum Expert
    Join Date
    07-15-2012
    Location
    Leghorn, Italy
    MS-Off Ver
    Excel 2010
    Posts
    3,431

    Re: Hide specific Rows in Sheet1 + hide 5 more in Sheet2

    I'm sorry, but I can not understand your goal

  11. #11
    Registered User
    Join Date
    05-16-2014
    Location
    Germany
    MS-Off Ver
    Excel 2010
    Posts
    78

    Re: Hide specific Rows in Sheet1 + hide 5 more in Sheet2

    My goal is to Select specific rows via InputBox.
    This code is in the file and working fine. But it Only works in Sheet1.

    I enter row number "33" and row 9 is hide.
    For Example in row 9 is some data with the name "33".

    But if i don't need the information from position "33", i also dont need the additional information from position "33" on Sheet2.
    In Sheet2 are more information about position "33" from Sheet1. For example "33.1", "33.2", .... And thezy should also hide when i
    hide "33" from Sheet1.

    You know what i mean?

  12. #12
    Registered User
    Join Date
    05-16-2014
    Location
    Germany
    MS-Off Ver
    Excel 2010
    Posts
    78

    Re: Hide specific Rows in Sheet1 + hide 5 more in Sheet2

    @Patel: do you need more Information?

  13. #13
    Registered User
    Join Date
    05-16-2014
    Location
    Germany
    MS-Off Ver
    Excel 2010
    Posts
    78

    Re: Hide specific Rows in Sheet1 + hide 5 more in Sheet2

    or any other one a solution for me?

  14. #14
    Forum Expert
    Join Date
    07-15-2012
    Location
    Leghorn, Italy
    MS-Off Ver
    Excel 2010
    Posts
    3,431

    Re: Hide specific Rows in Sheet1 + hide 5 more in Sheet2

    Quote Originally Posted by patel45 View Post
    why do you want enter the rows numbers and not the value you have to hide ?
    see attached
    did you answer me ?
    your goal is just now not clear for me
    Last edited by patel45; 05-28-2014 at 04:16 AM.

  15. #15
    Registered User
    Join Date
    05-16-2014
    Location
    Germany
    MS-Off Ver
    Excel 2010
    Posts
    78

    Re: Hide specific Rows in Sheet1 + hide 5 more in Sheet2

    ok, my mistake.

    of course i will enter the value an than hide the row in which the value is.
    This is ok. But if i Start your Macro it will Stop after enter the number. It hide the row (with the number i select) but it dont hide the number+.1, number+.2 in Sheet2.

    Now it is clear?

  16. #16
    Forum Expert
    Join Date
    07-15-2012
    Location
    Leghorn, Italy
    MS-Off Ver
    Excel 2010
    Posts
    3,431

    Re: Hide specific Rows in Sheet1 + hide 5 more in Sheet2

    No It's not clear, my post #6 is the answer

  17. #17
    Registered User
    Join Date
    05-16-2014
    Location
    Germany
    MS-Off Ver
    Excel 2010
    Posts
    78

    Re: Hide specific Rows in Sheet1 + hide 5 more in Sheet2

    Hi Patel,

    i have changed your code a little bit. Now it works like i need it.
    But there is one mistake in the code. If i don't enter a position in TextBox1 for example all rows hide.

    Do anyone have an answer why?

    Thank you

    HideRowSheet1Sheet2.xlsm

  18. #18
    Forum Expert
    Join Date
    07-15-2012
    Location
    Leghorn, Italy
    MS-Off Ver
    Excel 2010
    Posts
    3,431

    Re: Hide specific Rows in Sheet1 + hide 5 more in Sheet2

    Please Login or Register  to view this content.
    Last edited by patel45; 06-02-2014 at 06:43 AM.

  19. #19
    Registered User
    Join Date
    05-16-2014
    Location
    Germany
    MS-Off Ver
    Excel 2010
    Posts
    78

    Re: Hide specific Rows in Sheet1 + hide 5 more in Sheet2

    Thank you

    Everything works fine

  20. #20
    Registered User
    Join Date
    05-16-2014
    Location
    Germany
    MS-Off Ver
    Excel 2010
    Posts
    78

    Re: Hide specific Rows in Sheet1 + hide 5 more in Sheet2

    since your last change it doesn't work anymore

+ 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. Hide/show shape on Sheet1 based on cell value in Sheet2?
    By Guple in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 12-05-2013, 02:12 PM
  2. Find Values from Sheet2 on Sheet 1 and Hide Those Rows
    By lowprofile in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-17-2013, 11:02 PM
  3. [SOLVED] Macro to pull imported data from sheet2 and place data in specific rows on sheet1
    By PatRiot199 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 02-05-2013, 04:22 PM
  4. Hide value (and row) in Sheet1 if it is NOT in Sheet2
    By GalmOne in forum Excel Programming / VBA / Macros
    Replies: 20
    Last Post: 08-02-2012, 02:04 PM
  5. Hide columns on sheet2 based on cell on sheet1?
    By proepert in forum Excel General
    Replies: 4
    Last Post: 01-25-2010, 09:00 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