I found a VBA code in hiding & unhiding row in the internet, but my problem is when I re-coding it so that it will suit for my needs it wont work.
Please Help me!
Thank you!
I found a VBA code in hiding & unhiding row in the internet, but my problem is when I re-coding it so that it will suit for my needs it wont work.
Please Help me!
Thank you!
if G14=4 then dp5 & dp6 value under column D will become zero, which is a no problem to be coz my excel formulae is ok. My problem is I cant hide the rows when column D value is zero.
Hi, znalron@yahoo.com,
your description seems to differ from the file you posted (there are no formulas in there). If there´s a formula displaying 0 the line will be hidden.
For unhiding you should simplify the code to
Ciao,![]()
Please Login or Register to view this content.
Holger
Use Code-Tags for showing your code: [code] Your Code here [/code]
Please mark your question Solved if there has been offered a solution that works fine for you
HI HaHoBe!
What I mean was, in my actual Excel file, my formula is: IF(AND(G14=4,G15=3,G17=2) then the value of D28:D29, D36:D38 & D43:D46 is zero. Sorry for my sample attach file is wrong.
When I manually put a zero value in any of this cell(D28:D29, D36:D38 & D43:D46), it does not "automatically" hides row. So that is my problem.
Please Help me!
Hi, znalron@yahoo.com,
both the formula
in D28 as well as 0 in D29 lead to these rows being hidden by the code - at least in my file.![]()
Please Login or Register to view this content.
Ciao,
Holger
Actually the code is working good, it hides & unhides rows....but NOT automatically.
Hi, znalron@yahoo.com,
maybe place that in the opening post as still the event on which the code should start working is not mentioned (for example Workbook_Open, Worksheet_Activate, Worksheet_Change, Worksheet_BeforeDoubleClick).
Ciao,
Holger
This code is very slow.
The Unhide code shoul be:-
I will look at the hide code in a bit.![]()
Please Login or Register to view this content.
I assume that you want the macro to run whenever the sheet is calculated.
BRB
Hi Mehmetcik!
Yes your right! In my Excel formula it needs to determine the "terms" then calculate the amount then it will appear in column D. After calculation then the hiding & unhiding of rows with the value of zero in column D will take place. As I said earlier, "the code is working good, it hides & unhides rows....but NOT automatically."
At present I just create a button that I will click to start the hiding & unhiding process.
Move your code to the sheet specific area for now.
Right Click on the sheet name at the bottom of excel and select view code.
Select worksheet on the left tab
select change on the right tab.
place your code inside the macro that is shown
Your macro will now run whenever the sheet is changed.
I will look at speeding it up for you.
This is not as fast as I would like
but a lot faster than you version.
S
Enjoy.
Hi mehmetcik!
rows 1-24 should not be hide no matter what the values are, only rows 25-438 will be moving.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks