Macro And IF Function Is True Then Macro 1 (hide) Is Used
May 20, 2006
I have 2 macros one hides a selection of rows and the other unhides them. What i want to be able to do is when an IF function is true then macro 1 (hide) is used. If the function is false then macro 2 (unhide) works. There is a code in VBA
View 3 Replies
ADVERTISEMENT
Dec 5, 2012
I want to run a macro if the result of an IF function is true.
E.g. cell J55 contains =IF(H55>I55,"Goodbye","")
H55 contains =NOW()
I55 contains =DATE(2012,12,31)
Now by changing the dates etc. it prints Goodbye.... simple enough, but what I want is for it to run a macro that selects a range from the previous year's figures and simply changes the fill colour on the range. The macro for this also works fine.
View 3 Replies
View Related
Jan 29, 2014
I am trying to find a library with vb/macros that can hide and unhide all worksheet tabs except one, the formula, and the menu bar.
View 1 Replies
View Related
Oct 22, 2009
I have this macro hiding rows, but not the right ones. I am trying to hide all rows where the Len of a cell in column C is > 1? What am I missing here?
View 4 Replies
View Related
Aug 2, 2009
I have a worksheet where I have around 300 rows, each with 7 columns. What I want to do is add a checkbox to each column. I plan on setting non-applicable checkboxes to mixed status and locking the worksheet. I will unlock applicable checkboxes and sumif or countif their value according to row-based scoring, for example, each checked checkbox represents a value of 3. I do not know VBA and have chose to use the form control checkboxes rather than ActiveX.
I believe that a formula for this would be something like: =SUMIF(B1:B3,True,"3") or =COUNTIF($B$1:$B$3,True)*3
I am wondering firstly if I have that right and secondly if there is a way to stop my checkboxes from displaying labels. Currently, if I click on one it displays True behind the active checkbox. If I uncheck it, it displays False.
View 8 Replies
View Related
Oct 16, 2009
I am trying to make a save&close workbook macro.
I found several examples on google, but unfortunatly it conflicts with another macro I use for forceing users to enable macros (hide all sheets except one if macros are disabled).
The attached file is an example contaning the save&close code and the show/hide sheets depending on macros enabled.
If the file is opened with macros disabled then only one sheet will be visible.
If the file is opened with macros enabled other sheets are visible.
The problem if that this code uses a custom save, witch makes the save&close not save... (in module1 and in ThisWorkbook)
The pourpose of the save&close is to make sure some users don't forget the excel open and thus block access to it. So if a certain idele time passes excel has to save and close without any confirmation messages.
View 10 Replies
View Related
Oct 28, 2008
I need a macro that would sort out the true value in column A, and paste it to another sheet (range A77)
View 10 Replies
View Related
Dec 4, 2009
I need a macro to copy and paste cells from one worksheet to another, if there is the word true in the column L of that row.
View 10 Replies
View Related
Sep 29, 2009
I need to find out which version of excel i am using in macro.I mean whether it is 2003 or 2007.Because i need to put 2 diff codes according to the version of excel.Can any one please provide me the macro code to findout the version of Excel.
View 9 Replies
View Related
Oct 14, 2006
if there's a macro that can be run to check one worksheet. In this worksheet there is a column where the value should be "true". If this value is true, I'd like to copy the entire row of data into another worksheet.
There can be multiple rows of data where this condition is met.
View 3 Replies
View Related
May 28, 2008
I am trying to allow the Command Button when clicked to go through multiple conditions before making a decision. So, when someone clicks on Command Button 3 the code should look to see if CheckBox1 is true, then it should check today's date, and if it is between a range of days, or even months, then it would add the number in TextBox1 with the amount already in cell H18. This event will happen every time someone clicks on the Command Button.
The end result is to have several sheets (4 total) for each quarter in the fiscal year, and if the dates are within those parameters, the clicking of the command button will update the correct sheet.
View 9 Replies
View Related
Nov 7, 2008
I've used VBA to make a picture appear when all the correct answers have been entered and it all works well. However, not to be too mean to 15 year olds, many of my students can be devious little feckers, and I want to hide and password protect the VBA code so that they can't just change the pictures visible section to true. I can password protect the workbook and worksheet, but not the VBA.
I'm entering the Visual Basic editor and I can see my simple script. I then click Tools - VBproject properties - protection. I'm clicking the "Lock Project for Viewing" box then filling in the password and confirming the password and clicking OK. But I can still see and edit my script, despite protecting the sheet and workbook.
View 3 Replies
View Related
Jul 20, 2006
i am looking for correct code to hide a row based on the cell value. for example, if G8 = 0, hide row 8
View 9 Replies
View Related
Sep 9, 2008
I'm not a VB programmer and have tried to write this macro but I can't seem to understand why it's not working.
View 11 Replies
View Related
May 22, 2009
I am looking for a macro to hide all toolbars i am using this at the moment
View 4 Replies
View Related
Jun 11, 2009
I have created this macro (below) in a standalone spreadsheet and the expected results are that Columns A,B,C,D,G,H will be displayed after I run the macro.
But when I use the same macro in my production worksheet (columns and ranges adjusted accordingly) this macro creates the following results: Column A is displayed and all the rest are hidden (B,C,D,E,F,G,H). I am stumped as to why this occurs. Can you advice me as to how to get this macro to work and display A,B,C,D,G,H ?
View 7 Replies
View Related
Feb 11, 2010
I have the code below, which works fine apart from I get a little square coming up every time I run the code, as this gives you a line the Chr(10) has to be there. When I tale the Chr(10) out the little square disappears but then I don't get a new line. I have set the formatting to "wrap text" but it is still showing up. I am not quite sure where to go from here, I have also done a ="test"&CHAR(10)&"test" and that worked fine with no little square.
View 11 Replies
View Related
Jan 5, 2012
I have the following piece of code to hide all worksheets in my workbook but modify it to hide the multiple charts I still have open after running this:
Code:
Sub HideAllSheets()
Application.ScreenUpdating = False
Dim ws As Worksheet
[Code].....
View 3 Replies
View Related
Jan 24, 2004
1. I can create basic macros .. but how do I write a macro to hide a range (of 10 rows) named "dmargin". That for my button no. 1.
2. How do I write a macro to unhide the named range "dmargin" for my button #2.
I tried using VB codes to achieve both conditions -- it works but it either continuously protects or unprotects my ws -- so I think it is better to use a low level codes (macro buttons).
View 5 Replies
View Related
Nov 19, 2013
optimize the above Mcro to hide rows with "0".
Sub HideRowsw()
With Excel.Application
.ScreenUpdating = False
.Calculation = xlCalculationManual
.EnableEvents = False
End With
[Code]...
View 1 Replies
View Related
Sep 23, 2007
I made this simple little macro to hide/unhide a row on a different sheet based on a check box. The row hides fine. The problem I have is unhide. I uncheck the box, but the row stays hidden. What am I missing to make this little gem come to life? This is for tracking popcorn sales for scouting and I'm trying to make it as easy to use as possible.
Sub Patrol1_Scout1()
If True Then
Sheets("Show_n_Deliver_Sold").Rows("7:7").EntireRow.Hidden = True
End If
If False Then
Sheets("Show_n_Deliver_Sold").Rows("7:7").EntireRow.Hidden = False
End If
End Sub
View 9 Replies
View Related
Jul 22, 2006
I have a series of worksheets in a single workbook. The problem is there are many rows that contain zeros across. The problem is that there is text in that row in case a number does show up there. I need a macro that will hide all of the rows containing zeros or no values.
View 2 Replies
View Related
Nov 23, 2006
I have an Excel spreadsheet from which I run a macro to open another workbook. This other workbook has multiple worksheets. The problem I have is that I never know which worksheet was left active whenever it was last saved. How do I revise my macro to open this workbook and make a specific worksheet active and hide all other worksheets?
View 9 Replies
View Related
Jan 15, 2008
I've written a macro to unprotect a sheet, unhide columns and reprotect the sheet. It works fine with 2 out of 3 worksheets. I cant find any reason why it wont work in the one sheet....
View 9 Replies
View Related
Dec 8, 2009
I am trying to return a TRUE or FALSE based on a date in a cell.
for example:
if cell A1 = 07/11/2009
I want A2 to show TRUE or FALSE if A1 is 14 days or more behind todays date.
I have tried stuff like:
=IF(A1=TODAY()-14,"True","False")
but it just always says false. EDIT: I have just noticed that if I change the date in A1 to exactly 14 days behind todays, it returns TRUE. So, it does work. Do I need to add a GREATER THAN in there?
View 6 Replies
View Related
May 30, 2006
created my 'IF' function with the 'True/False' statements, but i am wanting to have yes/no instead and i cant figure out how to do it.
View 9 Replies
View Related
Jun 9, 2006
I have a macro that imports a report. If the Charge Type in column A is BTOREPLX, I need to prefill the field next to it in column B with the text "REPLX", e.g. "REPLXCDROM". I've attached an example of the report.
View 5 Replies
View Related
Apr 25, 2014
Making a macro to work like this:
if each 4th row of each column (A to XFD) contain 1, hide every column that contain 1 at each 4th row..
So, when the result of my formula is 1 on D4, F4, and AB4, then D, F, and AB column would be hidden automatically when I ran the macro..
View 5 Replies
View Related
Apr 17, 2014
I'm having a problem with my macro .However, if i use the following script:
[Code]......
If i am correct all the rows with a value less than 1 should be hidden right? However, some rows are hidden when they shouldn't be.
Im working on a quotation with different products in it. And the rows with a 0 in it should be hidden and that's pretty much working. But it also hides some of the subtotals(which i dont want) and some stay unhidden.
View 6 Replies
View Related
Aug 2, 2014
continued from: [URL]
Option Explicit forces explicit declaration of all variables in the code. That is why i had to declare ws as worksheet using the Dim statement before using it in the code. It is recommended to have it - however for this code it wouldn't have mattered.
I'm not sure I exactly follow what you imply here. But yes, you can hide all the sheets at first and then "unhide" at the start of the macro. Let's say you have a "Start" sheet.. then:
[Code] .....
The workbook is used by other people too. I cannot just tell them to hide the sheets, it defeats the purpose. What I want is, when macro is disabled, they will only see the START sheet, otherwise, all sheets will be visible. To add to this, a new sheet is added everyday. Sheets name are calendar dates in mmdd format
View 4 Replies
View Related