Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
auto-hide & Auto-fit rows?
I've tried a couple macro's I've seen online, but I can't seem to make a
macro work to hide lines on my worksheet. I've got a quote worksheet with rows 13:130 available for quoting. In column A is where the quantity gets filled in automatically from a previous tab via a macro. I'd like this worksheet to automatically hid the any rows on this tab that do not have a quantity in column A. Also, I've got my worksheet o "Auto-fit" the rows in this worksheet and the worksheet that feeds information into it via a Macro to "Auto-Fit" rows to the description of the product, however it doesn't happen. Any idea what I should do here? Many thanks! |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
auto-hide & Auto-fit rows?
Nango, see if any of this works and Ill try to explain myself as I go along.
Sub HideRows() Range("A13").Activate Do Until ActiveCell.Rows.Count = 130 If IsEmpty(ActiveCell) Then Selection.EntireRow.Hidden = True ActiveCell.Offset(1,0).Activate Else: ActiveCell.Offset(1,0).Activate End If Loop End Sub This sub will go through rows 13-130 every time and hide any row that doesn't have a value. If you want to hide all the cells after that... add something like this Range(Range("A131"),Range("A131").End(xlDown).Hidd en = True LMK what else you need "NANGO" wrote: I've tried a couple macro's I've seen online, but I can't seem to make a macro work to hide lines on my worksheet. I've got a quote worksheet with rows 13:130 available for quoting. In column A is where the quantity gets filled in automatically from a previous tab via a macro. I'd like this worksheet to automatically hid the any rows on this tab that do not have a quantity in column A. Also, I've got my worksheet o "Auto-fit" the rows in this worksheet and the worksheet that feeds information into it via a Macro to "Auto-Fit" rows to the description of the product, however it doesn't happen. Any idea what I should do here? Many thanks! |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
auto-hide & Auto-fit rows?
Thanks for the help. The only problem is this seems to be going through
every row in the entire workbook Sub HideRows() Range("A13").Activate Do Until ActiveCell.Rows.Count = 130 If IsEmpty(ActiveCell) Then Selection.EntireRow.Hidden = True ActiveCell.Offset(1,0).Activate Else: ActiveCell.Offset(1,0).Activate End If Loop End Sub Any ideas? "AKphidelt" wrote: Nango, see if any of this works and Ill try to explain myself as I go along. Sub HideRows() Range("A13").Activate Do Until ActiveCell.Rows.Count = 130 If IsEmpty(ActiveCell) Then Selection.EntireRow.Hidden = True ActiveCell.Offset(1,0).Activate Else: ActiveCell.Offset(1,0).Activate End If Loop End Sub This sub will go through rows 13-130 every time and hide any row that doesn't have a value. If you want to hide all the cells after that... add something like this Range(Range("A131"),Range("A131").End(xlDown).Hidd en = True LMK what else you need "NANGO" wrote: I've tried a couple macro's I've seen online, but I can't seem to make a macro work to hide lines on my worksheet. I've got a quote worksheet with rows 13:130 available for quoting. In column A is where the quantity gets filled in automatically from a previous tab via a macro. I'd like this worksheet to automatically hid the any rows on this tab that do not have a quantity in column A. Also, I've got my worksheet o "Auto-fit" the rows in this worksheet and the worksheet that feeds information into it via a Macro to "Auto-Fit" rows to the description of the product, however it doesn't happen. Any idea what I should do here? Many thanks! |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
auto-hide & Auto-fit rows?
Alright change this line
Do Until ActiveCell.Rows.Count = 130 to Do Until ActiveCell.Address = "$A$131" Sorry "NANGO" wrote: Thanks for the help. The only problem is this seems to be going through every row in the entire workbook Sub HideRows() Range("A13").Activate Do Until ActiveCell.Rows.Count = 130 If IsEmpty(ActiveCell) Then Selection.EntireRow.Hidden = True ActiveCell.Offset(1,0).Activate Else: ActiveCell.Offset(1,0).Activate End If Loop End Sub Any ideas? "AKphidelt" wrote: Nango, see if any of this works and Ill try to explain myself as I go along. Sub HideRows() Range("A13").Activate Do Until ActiveCell.Rows.Count = 130 If IsEmpty(ActiveCell) Then Selection.EntireRow.Hidden = True ActiveCell.Offset(1,0).Activate Else: ActiveCell.Offset(1,0).Activate End If Loop End Sub This sub will go through rows 13-130 every time and hide any row that doesn't have a value. If you want to hide all the cells after that... add something like this Range(Range("A131"),Range("A131").End(xlDown).Hidd en = True LMK what else you need "NANGO" wrote: I've tried a couple macro's I've seen online, but I can't seem to make a macro work to hide lines on my worksheet. I've got a quote worksheet with rows 13:130 available for quoting. In column A is where the quantity gets filled in automatically from a previous tab via a macro. I'd like this worksheet to automatically hid the any rows on this tab that do not have a quantity in column A. Also, I've got my worksheet o "Auto-fit" the rows in this worksheet and the worksheet that feeds information into it via a Macro to "Auto-Fit" rows to the description of the product, however it doesn't happen. Any idea what I should do here? Many thanks! |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
auto-hide & Auto-fit rows?
Sorry, that makes the macro do nothing.
Sorry I'm not getting it right. Thanks "AKphidelt" wrote: Alright change this line Do Until ActiveCell.Rows.Count = 130 to Do Until ActiveCell.Address = "$A$131" Sorry "NANGO" wrote: Thanks for the help. The only problem is this seems to be going through every row in the entire workbook Sub HideRows() Range("A13").Activate Do Until ActiveCell.Rows.Count = 130 If IsEmpty(ActiveCell) Then Selection.EntireRow.Hidden = True ActiveCell.Offset(1,0).Activate Else: ActiveCell.Offset(1,0).Activate End If Loop End Sub Any ideas? "AKphidelt" wrote: Nango, see if any of this works and Ill try to explain myself as I go along. Sub HideRows() Range("A13").Activate Do Until ActiveCell.Rows.Count = 130 If IsEmpty(ActiveCell) Then Selection.EntireRow.Hidden = True ActiveCell.Offset(1,0).Activate Else: ActiveCell.Offset(1,0).Activate End If Loop End Sub This sub will go through rows 13-130 every time and hide any row that doesn't have a value. If you want to hide all the cells after that... add something like this Range(Range("A131"),Range("A131").End(xlDown).Hidd en = True LMK what else you need "NANGO" wrote: I've tried a couple macro's I've seen online, but I can't seem to make a macro work to hide lines on my worksheet. I've got a quote worksheet with rows 13:130 available for quoting. In column A is where the quantity gets filled in automatically from a previous tab via a macro. I'd like this worksheet to automatically hid the any rows on this tab that do not have a quantity in column A. Also, I've got my worksheet o "Auto-fit" the rows in this worksheet and the worksheet that feeds information into it via a Macro to "Auto-Fit" rows to the description of the product, however it doesn't happen. Any idea what I should do here? Many thanks! |
#6
Posted to microsoft.public.excel.programming
|
|||
|
|||
auto-hide & Auto-fit rows?
Alright, don't touch anything, just copy and paste this exactly as shown in
to a regular module. Go to the VBE and go to Insert--- Module And then paste this in to it. Sub HideRows() Range("A13").Activate Do Until ActiveCell.Address = "$A$131" If IsEmpty(ActiveCell) Then Selection.EntireRow.Hidden = True ActiveCell.Offset(1,0).Activate Else: ActiveCell.Offset(1,0).Activate End If Loop End Sub "NANGO" wrote: Sorry, that makes the macro do nothing. Sorry I'm not getting it right. Thanks "AKphidelt" wrote: Alright change this line Do Until ActiveCell.Rows.Count = 130 to Do Until ActiveCell.Address = "$A$131" Sorry "NANGO" wrote: Thanks for the help. The only problem is this seems to be going through every row in the entire workbook Sub HideRows() Range("A13").Activate Do Until ActiveCell.Rows.Count = 130 If IsEmpty(ActiveCell) Then Selection.EntireRow.Hidden = True ActiveCell.Offset(1,0).Activate Else: ActiveCell.Offset(1,0).Activate End If Loop End Sub Any ideas? "AKphidelt" wrote: Nango, see if any of this works and Ill try to explain myself as I go along. Sub HideRows() Range("A13").Activate Do Until ActiveCell.Rows.Count = 130 If IsEmpty(ActiveCell) Then Selection.EntireRow.Hidden = True ActiveCell.Offset(1,0).Activate Else: ActiveCell.Offset(1,0).Activate End If Loop End Sub This sub will go through rows 13-130 every time and hide any row that doesn't have a value. If you want to hide all the cells after that... add something like this Range(Range("A131"),Range("A131").End(xlDown).Hidd en = True LMK what else you need "NANGO" wrote: I've tried a couple macro's I've seen online, but I can't seem to make a macro work to hide lines on my worksheet. I've got a quote worksheet with rows 13:130 available for quoting. In column A is where the quantity gets filled in automatically from a previous tab via a macro. I'd like this worksheet to automatically hid the any rows on this tab that do not have a quantity in column A. Also, I've got my worksheet o "Auto-fit" the rows in this worksheet and the worksheet that feeds information into it via a Macro to "Auto-Fit" rows to the description of the product, however it doesn't happen. Any idea what I should do here? Many thanks! |
#7
Posted to microsoft.public.excel.programming
|
|||
|
|||
auto-hide & Auto-fit rows?
I'll let you go for now. I'm not sure what I'm doing wrong. Except this is
the first time I've ever tried VBE and I've never gotten even a simple macro to work. Sorry to take so much time. Thank you very much for all your help. "AKphidelt" wrote: Alright, don't touch anything, just copy and paste this exactly as shown in to a regular module. Go to the VBE and go to Insert--- Module And then paste this in to it. Sub HideRows() Range("A13").Activate Do Until ActiveCell.Address = "$A$131" If IsEmpty(ActiveCell) Then Selection.EntireRow.Hidden = True ActiveCell.Offset(1,0).Activate Else: ActiveCell.Offset(1,0).Activate End If Loop End Sub "NANGO" wrote: Sorry, that makes the macro do nothing. Sorry I'm not getting it right. Thanks "AKphidelt" wrote: Alright change this line Do Until ActiveCell.Rows.Count = 130 to Do Until ActiveCell.Address = "$A$131" Sorry "NANGO" wrote: Thanks for the help. The only problem is this seems to be going through every row in the entire workbook Sub HideRows() Range("A13").Activate Do Until ActiveCell.Rows.Count = 130 If IsEmpty(ActiveCell) Then Selection.EntireRow.Hidden = True ActiveCell.Offset(1,0).Activate Else: ActiveCell.Offset(1,0).Activate End If Loop End Sub Any ideas? "AKphidelt" wrote: Nango, see if any of this works and Ill try to explain myself as I go along. Sub HideRows() Range("A13").Activate Do Until ActiveCell.Rows.Count = 130 If IsEmpty(ActiveCell) Then Selection.EntireRow.Hidden = True ActiveCell.Offset(1,0).Activate Else: ActiveCell.Offset(1,0).Activate End If Loop End Sub This sub will go through rows 13-130 every time and hide any row that doesn't have a value. If you want to hide all the cells after that... add something like this Range(Range("A131"),Range("A131").End(xlDown).Hidd en = True LMK what else you need "NANGO" wrote: I've tried a couple macro's I've seen online, but I can't seem to make a macro work to hide lines on my worksheet. I've got a quote worksheet with rows 13:130 available for quoting. In column A is where the quantity gets filled in automatically from a previous tab via a macro. I'd like this worksheet to automatically hid the any rows on this tab that do not have a quantity in column A. Also, I've got my worksheet o "Auto-fit" the rows in this worksheet and the worksheet that feeds information into it via a Macro to "Auto-Fit" rows to the description of the product, however it doesn't happen. Any idea what I should do here? Many thanks! |
#8
Posted to microsoft.public.excel.programming
|
|||
|
|||
auto-hide & Auto-fit rows?
No problem, glad to help. I'm actually in Prudhoe Bay right now working on an
oil field as a financial analyst. We work 12-15 hour days, 7 days a week... so I have a lot of free time on my hands, lol. Have a good one. "NANGO" wrote: I'll let you go for now. I'm not sure what I'm doing wrong. Except this is the first time I've ever tried VBE and I've never gotten even a simple macro to work. Sorry to take so much time. Thank you very much for all your help. "AKphidelt" wrote: Alright, don't touch anything, just copy and paste this exactly as shown in to a regular module. Go to the VBE and go to Insert--- Module And then paste this in to it. Sub HideRows() Range("A13").Activate Do Until ActiveCell.Address = "$A$131" If IsEmpty(ActiveCell) Then Selection.EntireRow.Hidden = True ActiveCell.Offset(1,0).Activate Else: ActiveCell.Offset(1,0).Activate End If Loop End Sub "NANGO" wrote: Sorry, that makes the macro do nothing. Sorry I'm not getting it right. Thanks "AKphidelt" wrote: Alright change this line Do Until ActiveCell.Rows.Count = 130 to Do Until ActiveCell.Address = "$A$131" Sorry "NANGO" wrote: Thanks for the help. The only problem is this seems to be going through every row in the entire workbook Sub HideRows() Range("A13").Activate Do Until ActiveCell.Rows.Count = 130 If IsEmpty(ActiveCell) Then Selection.EntireRow.Hidden = True ActiveCell.Offset(1,0).Activate Else: ActiveCell.Offset(1,0).Activate End If Loop End Sub Any ideas? "AKphidelt" wrote: Nango, see if any of this works and Ill try to explain myself as I go along. Sub HideRows() Range("A13").Activate Do Until ActiveCell.Rows.Count = 130 If IsEmpty(ActiveCell) Then Selection.EntireRow.Hidden = True ActiveCell.Offset(1,0).Activate Else: ActiveCell.Offset(1,0).Activate End If Loop End Sub This sub will go through rows 13-130 every time and hide any row that doesn't have a value. If you want to hide all the cells after that... add something like this Range(Range("A131"),Range("A131").End(xlDown).Hidd en = True LMK what else you need "NANGO" wrote: I've tried a couple macro's I've seen online, but I can't seem to make a macro work to hide lines on my worksheet. I've got a quote worksheet with rows 13:130 available for quoting. In column A is where the quantity gets filled in automatically from a previous tab via a macro. I'd like this worksheet to automatically hid the any rows on this tab that do not have a quantity in column A. Also, I've got my worksheet o "Auto-fit" the rows in this worksheet and the worksheet that feeds information into it via a Macro to "Auto-Fit" rows to the description of the product, however it doesn't happen. Any idea what I should do here? Many thanks! |
#9
Posted to microsoft.public.excel.programming
|
|||
|
|||
auto-hide & Auto-fit rows?
Yikes! I bet you could make my whole quote tool ten times better than it is.
"AKphidelt" wrote: No problem, glad to help. I'm actually in Prudhoe Bay right now working on an oil field as a financial analyst. We work 12-15 hour days, 7 days a week... so I have a lot of free time on my hands, lol. Have a good one. "NANGO" wrote: I'll let you go for now. I'm not sure what I'm doing wrong. Except this is the first time I've ever tried VBE and I've never gotten even a simple macro to work. Sorry to take so much time. Thank you very much for all your help. "AKphidelt" wrote: Alright, don't touch anything, just copy and paste this exactly as shown in to a regular module. Go to the VBE and go to Insert--- Module And then paste this in to it. Sub HideRows() Range("A13").Activate Do Until ActiveCell.Address = "$A$131" If IsEmpty(ActiveCell) Then Selection.EntireRow.Hidden = True ActiveCell.Offset(1,0).Activate Else: ActiveCell.Offset(1,0).Activate End If Loop End Sub "NANGO" wrote: Sorry, that makes the macro do nothing. Sorry I'm not getting it right. Thanks "AKphidelt" wrote: Alright change this line Do Until ActiveCell.Rows.Count = 130 to Do Until ActiveCell.Address = "$A$131" Sorry "NANGO" wrote: Thanks for the help. The only problem is this seems to be going through every row in the entire workbook Sub HideRows() Range("A13").Activate Do Until ActiveCell.Rows.Count = 130 If IsEmpty(ActiveCell) Then Selection.EntireRow.Hidden = True ActiveCell.Offset(1,0).Activate Else: ActiveCell.Offset(1,0).Activate End If Loop End Sub Any ideas? "AKphidelt" wrote: Nango, see if any of this works and Ill try to explain myself as I go along. Sub HideRows() Range("A13").Activate Do Until ActiveCell.Rows.Count = 130 If IsEmpty(ActiveCell) Then Selection.EntireRow.Hidden = True ActiveCell.Offset(1,0).Activate Else: ActiveCell.Offset(1,0).Activate End If Loop End Sub This sub will go through rows 13-130 every time and hide any row that doesn't have a value. If you want to hide all the cells after that... add something like this Range(Range("A131"),Range("A131").End(xlDown).Hidd en = True LMK what else you need "NANGO" wrote: I've tried a couple macro's I've seen online, but I can't seem to make a macro work to hide lines on my worksheet. I've got a quote worksheet with rows 13:130 available for quoting. In column A is where the quantity gets filled in automatically from a previous tab via a macro. I'd like this worksheet to automatically hid the any rows on this tab that do not have a quantity in column A. Also, I've got my worksheet o "Auto-fit" the rows in this worksheet and the worksheet that feeds information into it via a Macro to "Auto-Fit" rows to the description of the product, however it doesn't happen. Any idea what I should do here? Many thanks! |
#10
Posted to microsoft.public.excel.programming
|
|||
|
|||
auto-hide & Auto-fit rows?
Just keep asking questions
"NANGO" wrote: Yikes! I bet you could make my whole quote tool ten times better than it is. "AKphidelt" wrote: No problem, glad to help. I'm actually in Prudhoe Bay right now working on an oil field as a financial analyst. We work 12-15 hour days, 7 days a week... so I have a lot of free time on my hands, lol. Have a good one. "NANGO" wrote: I'll let you go for now. I'm not sure what I'm doing wrong. Except this is the first time I've ever tried VBE and I've never gotten even a simple macro to work. Sorry to take so much time. Thank you very much for all your help. "AKphidelt" wrote: Alright, don't touch anything, just copy and paste this exactly as shown in to a regular module. Go to the VBE and go to Insert--- Module And then paste this in to it. Sub HideRows() Range("A13").Activate Do Until ActiveCell.Address = "$A$131" If IsEmpty(ActiveCell) Then Selection.EntireRow.Hidden = True ActiveCell.Offset(1,0).Activate Else: ActiveCell.Offset(1,0).Activate End If Loop End Sub "NANGO" wrote: Sorry, that makes the macro do nothing. Sorry I'm not getting it right. Thanks "AKphidelt" wrote: Alright change this line Do Until ActiveCell.Rows.Count = 130 to Do Until ActiveCell.Address = "$A$131" Sorry "NANGO" wrote: Thanks for the help. The only problem is this seems to be going through every row in the entire workbook Sub HideRows() Range("A13").Activate Do Until ActiveCell.Rows.Count = 130 If IsEmpty(ActiveCell) Then Selection.EntireRow.Hidden = True ActiveCell.Offset(1,0).Activate Else: ActiveCell.Offset(1,0).Activate End If Loop End Sub Any ideas? "AKphidelt" wrote: Nango, see if any of this works and Ill try to explain myself as I go along. Sub HideRows() Range("A13").Activate Do Until ActiveCell.Rows.Count = 130 If IsEmpty(ActiveCell) Then Selection.EntireRow.Hidden = True ActiveCell.Offset(1,0).Activate Else: ActiveCell.Offset(1,0).Activate End If Loop End Sub This sub will go through rows 13-130 every time and hide any row that doesn't have a value. If you want to hide all the cells after that... add something like this Range(Range("A131"),Range("A131").End(xlDown).Hidd en = True LMK what else you need "NANGO" wrote: I've tried a couple macro's I've seen online, but I can't seem to make a macro work to hide lines on my worksheet. I've got a quote worksheet with rows 13:130 available for quoting. In column A is where the quantity gets filled in automatically from a previous tab via a macro. I'd like this worksheet to automatically hid the any rows on this tab that do not have a quantity in column A. Also, I've got my worksheet o "Auto-fit" the rows in this worksheet and the worksheet that feeds information into it via a Macro to "Auto-Fit" rows to the description of the product, however it doesn't happen. Any idea what I should do here? Many thanks! |
#11
Posted to microsoft.public.excel.programming
|
|||
|
|||
auto-hide & Auto-fit rows?
I'll take you up on that offer. But I better get to working on my real work
for today. "AKphidelt" wrote: Just keep asking questions "NANGO" wrote: Yikes! I bet you could make my whole quote tool ten times better than it is. "AKphidelt" wrote: No problem, glad to help. I'm actually in Prudhoe Bay right now working on an oil field as a financial analyst. We work 12-15 hour days, 7 days a week... so I have a lot of free time on my hands, lol. Have a good one. "NANGO" wrote: I'll let you go for now. I'm not sure what I'm doing wrong. Except this is the first time I've ever tried VBE and I've never gotten even a simple macro to work. Sorry to take so much time. Thank you very much for all your help. "AKphidelt" wrote: Alright, don't touch anything, just copy and paste this exactly as shown in to a regular module. Go to the VBE and go to Insert--- Module And then paste this in to it. Sub HideRows() Range("A13").Activate Do Until ActiveCell.Address = "$A$131" If IsEmpty(ActiveCell) Then Selection.EntireRow.Hidden = True ActiveCell.Offset(1,0).Activate Else: ActiveCell.Offset(1,0).Activate End If Loop End Sub "NANGO" wrote: Sorry, that makes the macro do nothing. Sorry I'm not getting it right. Thanks "AKphidelt" wrote: Alright change this line Do Until ActiveCell.Rows.Count = 130 to Do Until ActiveCell.Address = "$A$131" Sorry "NANGO" wrote: Thanks for the help. The only problem is this seems to be going through every row in the entire workbook Sub HideRows() Range("A13").Activate Do Until ActiveCell.Rows.Count = 130 If IsEmpty(ActiveCell) Then Selection.EntireRow.Hidden = True ActiveCell.Offset(1,0).Activate Else: ActiveCell.Offset(1,0).Activate End If Loop End Sub Any ideas? "AKphidelt" wrote: Nango, see if any of this works and Ill try to explain myself as I go along. Sub HideRows() Range("A13").Activate Do Until ActiveCell.Rows.Count = 130 If IsEmpty(ActiveCell) Then Selection.EntireRow.Hidden = True ActiveCell.Offset(1,0).Activate Else: ActiveCell.Offset(1,0).Activate End If Loop End Sub This sub will go through rows 13-130 every time and hide any row that doesn't have a value. If you want to hide all the cells after that... add something like this Range(Range("A131"),Range("A131").End(xlDown).Hidd en = True LMK what else you need "NANGO" wrote: I've tried a couple macro's I've seen online, but I can't seem to make a macro work to hide lines on my worksheet. I've got a quote worksheet with rows 13:130 available for quoting. In column A is where the quantity gets filled in automatically from a previous tab via a macro. I'd like this worksheet to automatically hid the any rows on this tab that do not have a quantity in column A. Also, I've got my worksheet o "Auto-fit" the rows in this worksheet and the worksheet that feeds information into it via a Macro to "Auto-Fit" rows to the description of the product, however it doesn't happen. Any idea what I should do here? Many thanks! |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
auto hide blank rows | Excel Discussion (Misc queries) | |||
Auto Hide Blank Rows | Excel Discussion (Misc queries) | |||
Auto-Hide Rows Macro | Excel Worksheet Functions | |||
Auto Hide Columns & Rows | Excel Discussion (Misc queries) | |||
AUTO HIDE ROWS | Excel Worksheet Functions |