Announcement

Collapse
No announcement yet.

Excel Help

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Excel Help



    Hey,
    I am working on a spreadsheet, the goal to make a calculator that is straightforward and as streamlined can be. Right now, I have made it do most of the calculations for me, but I need help a little help.
    Is there a way to insert a combobox that when selecting between the three calculators I made, it will hide all rows and columns, except the ones related to that selection?
    Thanks!

  • #2
    .
    Yes

    After setting up your combobox you can use a line of code similar to :

    Code:
     
     Sub sbHidingUnHideRows() 'To Hide Rows 5 to 8 Rows("5:8").EntireRow.Hidden = True 'To UnHide Rows 22 to 25 Rows("5:8").EntireRow.Hidden = False End Sub

    Comment


    • #3

      Yes

      After setting up your combobox you can use a line of code similar to :

      Code:
       
       Sub sbHidingUnHideRows() 'To Hide Rows 5 to 8 Rows("5:8").EntireRow.Hidden = True 'To UnHide Rows 22 to 25 Rows("5:8").EntireRow.Hidden = False End Sub

      Comment


      • #4
        Cross-posting Without Links

        Your post does not comply with our Forum RULES. Do not cross-post your question on multiple forums without including links here to the other threads on other forums.

        Cross-posting is when you post the same question in other forums on the web. The last thing you want to do is waste people's time working on an issue you have already resolved elsewhere. We prefer that you not cross-post at all, but if you do (and it's unlikely to go unnoticed), you MUST provide a link (copy the url from the address bar in your browser) to the cross-post.

        Expect cross-posted questions without a link to be closed and a message will be posted by the moderator explaining why. We are here to help so help us to help you!

        Read this to understand why we ask you to do this, and then please edit your first post to include links to any and all cross-posts in any other forums (not just this site).

        No further help to be offered, please, until the OP has complied with this request.
        Ali

        Enthusiastic self-taught user of MS Excel who's always learning!
        If anyone has helped you towards solving a problem, then you can thank them by clicking on the like icon bottom right.

        Comment


        • #5
          Sorry, here's the link to the to the other post: https://www.mrexcel.com/forum/excel-...alculator.html.

          Comment


          • #6
            Cross-Posted Here: https://www.mrexcel.com/forum/excel-...alculator.html. Sorry, I will try not to do that again. Thanks for the heads up.

            Comment


            • #7
              Baiano42

              I'm not certain what is causing the posting error. As shown above, I too experienced an issue responding earlier, where the forum server posted my message twice. Probably, when it appears the message hasn't been posted and you receive an error message, I'm suspecting if
              you simply get out of the forum and return you may find your message was actually posted.

              In any case, if you can post your workbook, without private data included, we can take a look at it for you. It's better to see what you are working with rather than guess how things are laid out.

              Comment


              • #8
                Here's the link to the calculator: https://www.dropbox.com/s/xavhulqwi9...ator.xlsx?dl=0

                Comment


                • #9
                  Here is that link to the calculator: https://www.dropbox.com/s/xavhulqwi9...ator.xlsx?dl=0

                  Comment


                  • #10


                    In Sheet2 level module :


                    Code:
                    Option Explicit
                    
                    Private Sub ComboBox1_Change()
                        Application.Run Sheet2.ComboBox1.Value
                    End Sub


                    In Routine Module :


                    Code:
                    Option Explicit
                    
                    Sub ALL() 'B:K
                        Columns.Hidden = False
                        Sheet2.Range("A1").Select
                    End Sub
                    
                    Sub INN() 'B:K
                    Dim ColCtr As Double
                    Application.ScreenUpdating = False
                        For ColCtr = 11 To 30
                            Columns(ColCtr).EntireColumn.Hidden = True
                        Next ColCtr
                    
                        For ColCtr = 2 To 10
                            Columns(ColCtr).EntireColumn.Hidden = False
                        Next ColCtr
                        Sheet2.Range("A1").Select
                        Application.ScreenUpdating = True
                    End Sub
                    
                    Private Sub OON() 'K:T
                    Dim ColCtr As Double
                    Application.ScreenUpdating = False
                        For ColCtr = 2 To 12
                            Columns(ColCtr).EntireColumn.Hidden = True
                        Next ColCtr
                        For ColCtr = 21 To 30
                            Columns(ColCtr).EntireColumn.Hidden = True
                        Next ColCtr
                    
                        For ColCtr = 12 To 20
                            Columns(ColCtr).EntireColumn.Hidden = False
                        Next ColCtr
                        Sheet2.Range("A1").Select
                        Application.ScreenUpdating = True
                    End Sub
                    
                    Private Sub SECONDARY() 'U:AC
                    Dim ColCtr As Double
                    Application.ScreenUpdating = False
                        For ColCtr = 2 To 21
                            Columns(ColCtr).EntireColumn.Hidden = True
                        Next ColCtr
                    
                        For ColCtr = 22 To 31
                            Columns(ColCtr).EntireColumn.Hidden = False
                        Next ColCtr
                        Sheet2.Range("A1").Select
                        Application.ScreenUpdating = True
                    End Sub

                    In ThisWorkbook Module :


                    Code:
                    Option Explicit
                    
                    Private Sub Workbook_Open()
                        Sheet2.ComboBox1.List = Sheet2.Range("A2:A5").Value
                    End Sub

                    Sheet2 Cells A2:A5 have the Combobox List Names - font color black to obscure from view.


                    Download workbook : https://www.amazon.com/clouddrive/sh...PTifib6jXeThOH

                    Comment

                    Working...
                    X