close

I have a form that I have created in excel and I want to know how to hide
rows automatically, that do not have data in them, with a formula. The form
pulls information from other sheets.

Select the range of cells you want to check, and run this macro:

Sub HideRows()
Dim rn As Range
Dim rng As Range
Set rng = Selection
For Each rn In rng.Cells
If (rn.Value = quot;quot;) Then
Rows(rn.Row).Hidden = True
End If
Next
End Sub--
Regards,
Davequot;Soniaquot; wrote:

gt; I have a form that I have created in excel and I want to know how to hide
gt; rows automatically, that do not have data in them, with a formula. The form
gt; pulls information from other sheets.

I have never used macros, how do I do it?

quot;David Billigmeierquot; wrote:

gt; Select the range of cells you want to check, and run this macro:
gt;
gt; Sub HideRows()
gt; Dim rn As Range
gt; Dim rng As Range
gt; Set rng = Selection
gt; For Each rn In rng.Cells
gt; If (rn.Value = quot;quot;) Then
gt; Rows(rn.Row).Hidden = True
gt; End If
gt; Next
gt; End Sub
gt;
gt;
gt; --
gt; Regards,
gt; Dave
gt;
gt;
gt; quot;Soniaquot; wrote:
gt;
gt; gt; I have a form that I have created in excel and I want to know how to hide
gt; gt; rows automatically, that do not have data in them, with a formula. The form
gt; gt; pulls information from other sheets.

First, right click on the tab of the worksheet that has the rows you want
hidden and choose quot;View Codequot; (you can also hit Alt F11 and double click your
sheet name). This will open up the VBA window.

Second, just paste in the code.

Third, from your worksheet, hit Alt F8, click on the quot;HideRowsquot; macro, and
hit run

Does that help?
--
Regards,
Davequot;Soniaquot; wrote:

gt; I have never used macros, how do I do it?
gt;
gt; quot;David Billigmeierquot; wrote:
gt;
gt; gt; Select the range of cells you want to check, and run this macro:
gt; gt;
gt; gt; Sub HideRows()
gt; gt; Dim rn As Range
gt; gt; Dim rng As Range
gt; gt; Set rng = Selection
gt; gt; For Each rn In rng.Cells
gt; gt; If (rn.Value = quot;quot;) Then
gt; gt; Rows(rn.Row).Hidden = True
gt; gt; End If
gt; gt; Next
gt; gt; End Sub
gt; gt;
gt; gt;
gt; gt; --
gt; gt; Regards,
gt; gt; Dave
gt; gt;
gt; gt;
gt; gt; quot;Soniaquot; wrote:
gt; gt;
gt; gt; gt; I have a form that I have created in excel and I want to know how to hide
gt; gt; gt; rows automatically, that do not have data in them, with a formula. The form
gt; gt; gt; pulls information from other sheets.

Yes, I figure it out, but it is really slow, the whole screen goes crazy.

I was kind of hoping there was a way it would do it with out me having to
press Alt f11. I want to be able to go in and if the rows pull data they
will open up and close on there own if there isn't data. Any such thing?

quot;David Billigmeierquot; wrote:

gt; First, right click on the tab of the worksheet that has the rows you want
gt; hidden and choose quot;View Codequot; (you can also hit Alt F11 and double click your
gt; sheet name). This will open up the VBA window.
gt;
gt; Second, just paste in the code.
gt;
gt; Third, from your worksheet, hit Alt F8, click on the quot;HideRowsquot; macro, and
gt; hit run
gt;
gt; Does that help?
gt; --
gt; Regards,
gt; Dave
gt;
gt;
gt; quot;Soniaquot; wrote:
gt;
gt; gt; I have never used macros, how do I do it?
gt; gt;
gt; gt; quot;David Billigmeierquot; wrote:
gt; gt;
gt; gt; gt; Select the range of cells you want to check, and run this macro:
gt; gt; gt;
gt; gt; gt; Sub HideRows()
gt; gt; gt; Dim rn As Range
gt; gt; gt; Dim rng As Range
gt; gt; gt; Set rng = Selection
gt; gt; gt; For Each rn In rng.Cells
gt; gt; gt; If (rn.Value = quot;quot;) Then
gt; gt; gt; Rows(rn.Row).Hidden = True
gt; gt; gt; End If
gt; gt; gt; Next
gt; gt; gt; End Sub
gt; gt; gt;
gt; gt; gt;
gt; gt; gt; --
gt; gt; gt; Regards,
gt; gt; gt; Dave
gt; gt; gt;
gt; gt; gt;
gt; gt; gt; quot;Soniaquot; wrote:
gt; gt; gt;
gt; gt; gt; gt; I have a form that I have created in excel and I want to know how to hide
gt; gt; gt; gt; rows automatically, that do not have data in them, with a formula. The form
gt; gt; gt; gt; pulls information from other sheets.

Might want to try the auto filter then... Data-gt;Filter-gt;Auto Filter. With
each re-pull of the data choose quot;NonBlanksquot; from the header drop down list.

--
Regards,
Davequot;Soniaquot; wrote:

gt; Yes, I figure it out, but it is really slow, the whole screen goes crazy.
gt;
gt; I was kind of hoping there was a way it would do it with out me having to
gt; press Alt f11. I want to be able to go in and if the rows pull data they
gt; will open up and close on there own if there isn't data. Any such thing?
gt;
gt; quot;David Billigmeierquot; wrote:
gt;
gt; gt; First, right click on the tab of the worksheet that has the rows you want
gt; gt; hidden and choose quot;View Codequot; (you can also hit Alt F11 and double click your
gt; gt; sheet name). This will open up the VBA window.
gt; gt;
gt; gt; Second, just paste in the code.
gt; gt;
gt; gt; Third, from your worksheet, hit Alt F8, click on the quot;HideRowsquot; macro, and
gt; gt; hit run
gt; gt;
gt; gt; Does that help?
gt; gt; --
gt; gt; Regards,
gt; gt; Dave
gt; gt;
gt; gt;
gt; gt; quot;Soniaquot; wrote:
gt; gt;
gt; gt; gt; I have never used macros, how do I do it?
gt; gt; gt;
gt; gt; gt; quot;David Billigmeierquot; wrote:
gt; gt; gt;
gt; gt; gt; gt; Select the range of cells you want to check, and run this macro:
gt; gt; gt; gt;
gt; gt; gt; gt; Sub HideRows()
gt; gt; gt; gt; Dim rn As Range
gt; gt; gt; gt; Dim rng As Range
gt; gt; gt; gt; Set rng = Selection
gt; gt; gt; gt; For Each rn In rng.Cells
gt; gt; gt; gt; If (rn.Value = quot;quot;) Then
gt; gt; gt; gt; Rows(rn.Row).Hidden = True
gt; gt; gt; gt; End If
gt; gt; gt; gt; Next
gt; gt; gt; gt; End Sub
gt; gt; gt; gt;
gt; gt; gt; gt;
gt; gt; gt; gt; --
gt; gt; gt; gt; Regards,
gt; gt; gt; gt; Dave
gt; gt; gt; gt;
gt; gt; gt; gt;
gt; gt; gt; gt; quot;Soniaquot; wrote:
gt; gt; gt; gt;
gt; gt; gt; gt; gt; I have a form that I have created in excel and I want to know how to hide
gt; gt; gt; gt; gt; rows automatically, that do not have data in them, with a formula. The form
gt; gt; gt; gt; gt; pulls information from other sheets.

arrow
arrow
    全站熱搜
    創作者介紹
    創作者 software 的頭像
    software

    software

    software 發表在 痞客邦 留言(0) 人氣()