Jump to content

Excel - Macro's


KugaWestie

Recommended Posts

Hi,

 

Anyone any good at writing Macros?

 

I want to be able to hide specific columns or rows that have a zero value in them.

 

Anyone able to help?

Link to comment
Share on other sites

Sub HURows()
    BeginRow = 1
    EndRow = 100
    ChkCol = 3

    For RowCnt = BeginRow To EndRow
        If Cells(RowCnt, ChkCol).Value = 0 Then
            Cells(RowCnt, ChkCol).EntireRow.Hidden = True
        Else
            Cells(RowCnt, ChkCol).EntireRow.Hidden = False
        End If
    Next RowCnt
End Sub

The above from http://excel.tips.net/ Plenty more out there...

  • Like 2
Link to comment
Share on other sites

I like that. TBH, I always think of "wouldn't it be better if..." Ideas like hiding null rows/columns when I'm in the middle of using a spreadsheet, and I've not got the time to research what to do, but that's exactly the sort of thing I could do with building into the main sheets I use.

 

Thanks for the idea! (Threads like this are one of the things I love about the Boardroom, out of the blue solutions to life's little niggles).

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

Please review our Terms of Use, Guidelines and Privacy Policy. We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.