I am using MS Query to pull off some information from our SQL database to create a report and without going into too much explanation, there are items popping up that should not be there (Sales orders that were supposed to be closed months ago etc). What I have been trying to do with a macro, with no success, is hide a row if the value of D2:D1500 is “” after the MS Query has run and unhide them when closing the sheet. I am very new to macros and I was able to hide one row at a time with a macro but it stopped as soon as there was data in a “D” cell and it took a long time. I have no idea how to unhide when I’m done.
Any help you folks could offer would be appreciated.
Stats
![]() |
Patch reliability is unclear. Unless you have an immediate, pressing need to install a specific patch, don't do it. |
SIGN IN | Not a member? | REGISTER | PLUS MEMBERSHIP |
-
Hide Row Macro (2000)
Home » Forums » AskWoody support » Productivity software by function » MS Excel and spreadsheet help » Hide Row Macro (2000)
- This topic has 16 replies, 5 voices, and was last updated 22 years, 7 months ago.
AuthorTopicWSStats
AskWoody LoungerJuly 12, 2002 at 4:01 pm #373545Viewing 0 reply threadsAuthorReplies-
WSJohnBF
AskWoody Lounger -
WSStats
AskWoody LoungerJuly 12, 2002 at 4:43 pm #600803Thanks for your quick reply.
I’m sorry, I forgot to mention that the cells in Col D contain a formula that returns the value “” if some conditions aren’t met. These conditions determine if the data retrieved is supposed to be there. Since the cells are not “blank” the macro is not hiding them.
It worked perfectly on rows that had no data though.
Thanks for your help. -
WSJohnBF
AskWoody LoungerJuly 12, 2002 at 4:54 pm #600806Stats, see if this does it for you:
Sub HideNullStringCellRows()
Dim rngCell As Range
For Each rngCell In Worksheets(“Sheet1”).Columns(“D:D”).SpecialCells(xlCellTypeFormulas, 2)
If rngCell.Value = “” Then rngCell.EntireRow.Hidden = True
Next rngCell
End SubThis version however doesn’t hide cells which are blank and contain no formula at all. Let me know if you also intend to hide those.
-
WSStats
AskWoody Lounger -
WSjlkirk
AskWoody Lounger -
WSsdckapr
AskWoody Lounger -
H. Legare Coleman
AskWoody Plus -
WSjlkirk
AskWoody Lounger -
H. Legare Coleman
AskWoody PlusOctober 7, 2002 at 1:33 pm #622382Sorry, I still don’t understand. Which columns do you want to hide? Do you want to hide them if there is data in any column of rows 3-10, or just if there is data in one column or a few columns? Are you trying to hide just the columns on the row where there is data, which is not possible? Lets say we get to row 4, and there is data in columns C, E, and F, what columns do you want to hide? Then, lets say we get to row 5 and there is data in a column that has already been hidden, what do you want to do?
-
WSjlkirk
AskWoody LoungerOctober 7, 2002 at 2:40 pm #622398Not your fault-I didn’t make myself clear. In my worksheet, each columns B-AE (or AF) represent a day of a month. Column A is reserved for a description of a product I price every day. There are 48 of these. Row 1 is reserved for the date in “mm/dd” format, and Row 2 for the day of the week in “DDDD” format, referencing the respective cell’s counterpart in Row 1.
I would like to input daily prices for these products in cells B3:AE51, and hide the columns where I have input the daily prices. For example, since today is the 7th, I will have already entered data in columns B-E, corresponding to Tuesday-Friday of last week (no prices for Saturdays and Sundays). Therefore, I would like to hide columns B-E.
I hope this makes more sense.
-
H. Legare Coleman
AskWoody PlusOctober 8, 2002 at 12:38 am #622552OK, I think we are close to being able to give you what you want. Just a couple of more questions.
1- Since there are no prices for Sat and Sun, do you want them included in the columns or would you like to eliminate them? How about holidays?
2- If you still want to include weekends and holidays in the columns, do you ever want to hide those columns? For instance, when you run the macro today, it would hide columns B through E. Columns F and G would be for Sat and Sun. Should those also be hidden? Same question for holidays?
3- Is there always a price for every product? In other words, if I find the last column with a price entered in row 3, can I just hide the columns B through that column, or do I have to look at all of the rows to find the last price entered?
-
WSjlkirk
AskWoody LoungerOctober 8, 2002 at 8:54 am #622619Legare,
1. I had planned in a formula to enter “N/A” for the weekend days. I would have to do it manually for holidays;
2. Yes-I had envisioned if there was either data or text in the cells in the columns (except, of course, rows 1 and 2 where the date and day show up), the columns would be hidden;
3. There will be prices for every product, every day (except, of course, Saturdays, Sundays & holidays).
Jeff -
H. Legare Coleman
AskWoody PlusOctober 9, 2002 at 2:30 am #622881 -
WSjlkirk
AskWoody Lounger -
H. Legare Coleman
AskWoody PlusOctober 9, 2002 at 1:49 pm #622965There were a couple of problems. First, when you copied the code from the Lounge you pasted directly into Excel. That causes the formatting to get all messed up, and the code would not compile. When you copy code from the Lounge, you have to paste it into Word first, then copy it from there and paste it into Excel. The second problem is that your worksheet was not exactly as I expecte it to be. You have some columns past the end of the daily data and you are filling in the “N/A” for the weekends before you get there. Both of those would cause the original macro to not work. Try the attached copy.
-
WSjlkirk
AskWoody Lounger
-
-
-
-
Viewing 0 reply threads -

Plus Membership
Donations from Plus members keep this site going. You can identify the people who support AskWoody by the Plus badge on their avatars.
AskWoody Plus members not only get access to all of the contents of this site -- including Susan Bradley's frequently updated Patch Watch listing -- they also receive weekly AskWoody Plus Newsletters (formerly Windows Secrets Newsletter) and AskWoody Plus Alerts, emails when there are important breaking developments.
Get Plus!
Welcome to our unique respite from the madness.
It's easy to post questions about Windows 11, Windows 10, Win8.1, Win7, Surface, Office, or browse through our Forums. Post anonymously or register for greater privileges. Keep it civil, please: Decorous Lounge rules strictly enforced. Questions? Contact Customer Support.
Search Newsletters
Search Forums
View the Forum
Search for Topics
Recent Topics
-
Documents, Pictures, Desktop on OneDrive in Windows 11
by
ThePhoenix
25 minutes ago -
End of 10
by
Alex5723
2 hours, 14 minutes ago -
End Of 10 : Move to Linux
by
Alex5723
2 hours, 43 minutes ago -
Single account cannot access printer’s automatic duplex functionality
by
Bruce
8 minutes ago -
Privacy and the Real ID
by
Susan Bradley
3 minutes ago -
MS-DEFCON 2: Deferring that upgrade
by
Susan Bradley
29 minutes ago -
Cant log on to oldergeeks.Com
by
WSJonharnew
15 hours, 38 minutes ago -
Upgrading from Win 10
by
WSjcgc50
55 seconds ago -
USB webcam / microphone missing after KB5050009 update
by
WSlloydkuhnle
7 hours, 42 minutes ago -
TeleMessage, a modified Signal clone used by US government has been hacked
by
Alex5723
1 day, 4 hours ago -
The story of Windows Longhorn
by
Cybertooth
16 hours ago -
Red x next to folder on OneDrive iPadOS
by
dmt_3904
1 day, 6 hours ago -
Are manuals extinct?
by
Susan Bradley
2 hours, 29 minutes ago -
Canonical ditching Sudo for Rust Sudo -rs starting with Ubuntu
by
Alex5723
1 day, 15 hours ago -
Network Issue
by
Casey H
1 day, 2 hours ago -
Fedora Linux is now an official WSL distro
by
Alex5723
2 days, 3 hours ago -
May 2025 Office non-Security updates
by
PKCano
2 days, 3 hours ago -
Windows 10 filehistory including onedrive folder
by
Steve Bondy
2 days, 5 hours ago -
pages print on restart (Win 11 23H2)
by
cyraxote
1 day, 6 hours ago -
Windows 11 Insider Preview build 26200.5581 released to DEV
by
joep517
2 days, 7 hours ago -
Windows 11 Insider Preview build 26120.3950 (24H2) released to BETA
by
joep517
2 days, 7 hours ago -
Proton to drop prices after ruling against “Apple tax”
by
Cybertooth
2 days, 15 hours ago -
24H2 Installer – don’t see Option for non destructive install
by
JP
1 day, 7 hours ago -
Asking Again here (New User and Fast change only backups)
by
thymej
3 days, 2 hours ago -
How much I spent on the Mac mini
by
Will Fastie
10 hours, 3 minutes ago -
How to get rid of Copilot in Microsoft 365
by
Lance Whitney
1 day, 5 hours ago -
Spring cleanup — 2025
by
Deanna McElveen
3 days, 8 hours ago -
Setting up Windows 11
by
Susan Bradley
2 days, 3 hours ago -
VLC Introduces Cutting-Edge AI Subtitling and Translation Capabilities
by
Alex5723
3 days, 3 hours ago -
Powershell version?
by
CWBillow
3 days, 4 hours ago
Recent blog posts
Key Links
Want to Advertise in the free newsletter? How about a gift subscription in honor of a birthday? Send an email to sb@askwoody.com to ask how.
Mastodon profile for DefConPatch
Mastodon profile for AskWoody
Home • About • FAQ • Posts & Privacy • Forums • My Account
Register • Free Newsletter • Plus Membership • Gift Certificates • MS-DEFCON Alerts
Copyright ©2004-2025 by AskWoody Tech LLC. All Rights Reserved.