I am using application.FileDialog to make the user select a file, when clicking a button. Now, I have tested, what happens, when I click on "Abort", instead of selecting a file and clicking "OK". An error message appears, because no file is selected. So my question is: How do I state in my code, what is supposed to happen, when the User Clicks on "abort" (I want the whole Sub to be aborted in this case)
I have two columns in a spreadsheet that I want to use an IF function with. In the first column, I want a pick list containing 5 text options. Depending on which option is chosen, I want a number to auto-populate in the second column.
The numbers are important, because I want to repeat this pair of cells with slightly different text values in the second pair, and then to have a column that multiplies the two resulting numbers and conditional formats the result.
Im copying and pasting data from one workbook to another but when I want to close the source workbook, it comes up with this message that I have much data and if I want to keep this in a clipboard. I thought I could disable this with Application.DisplayAlerts = False but when I do this, Excel freezes. Im I doing something wrong. How can I supress this window?
Public path As String Sub Get_data() path = "\Nlchoosa.nlOPS_Processes$OPS_ProcessesReports Sector performance" Workbooks.Open Filename:=path & "ReportsSector Performance Reporting week.xls" Range("A1").Select Range(Selection, Selection.End(xlToRight)).Select Range(Selection, Selection.End(xlDown)).Select Selection.copy Windows("Sector Performance report Week.xls").Activate ActiveSheet.Paste Application.DisplayClipboardWindow = False Windows("Sector Performance Reporting week.xls").Activate Application.DisplayAlerts = False End Sub
i am currently designing a userform which has a drop-down box for user to choose from the options given. However, i would like to have in the box fields such as "--Subjects", "English", "Maths", "Science". In this way, the user will be shown a list of options of the different subjects for them to choose from as well as to clearly identify to them that these are the subjects available therefore the heading "--Subjects". I would also have to make sure that the user can only select "English", "Maths", "Science" and NOT "--Subjects".
We have developed an Excel workbook with hundreds of lines of VBA code written for a specific application, and we would like to protect it.
Could someone give me an idea of what security options we have over and above the below (if any)?
We have protected all sheets and the workbook itself with passwords. The VBA itself is protected with a passoword.
My understanding is that VBA can be hacked into quite easily.....is there any way of adding another layer of security/protection without having to move to another platform altogether?
numbers in one column need to be rounded to the nearest half decimal, with next conditions(ill took number 704,00 for example): - if last two decimals are < 0,25 then my number has to be 704.00 - if last two decimals are >0,25<0,75 then my number has to be 704.50 - and finally if last two decimals are >0,75 then my number has to be 705.00
I tried with IF, CEILING, INT and ROUND functions but i didn't made it work with three options, that i need. I only made it work if i use only two options.
I would like to know how do I go about adding the following:
This is a test it counts out of 1250 points
But there are 3 fields which can be omitted from the grand total of 1250 Some students might not have all three fields. The fields totals are 30, 90 and 130. The students might have one or two of them in either order. Now what I would like to do is have 3 different fields where I can mark with a Y=Yes and N=No in a block. then it would change the Grand Total score accordingly.
How do I filter the options in column A to bring up results in Column B. I want to do a one-many filter where if the user selects an option in column A then the results/values in column B should be based upon the the user selection.
I recently added a macro in excel that stopped users from cutting and pasting and dragging etc. I got the macro from the web. I have delete the macro, but for some reason I cannot get it back to normal. If I right click on a cell the cut, copy, insert, delete, format cell menu is grayed out. The undo button also does not work? I have searched for the macro and deleted it but it seems to have changed something else. I have even tried to disable macros, but all menu items are still gone?
I use several different workbooks during the day, and sometimes I would prefer the " move selection after enter direction" option to = "Right" and sometimes "Down". It doesn't seem to be an option that is saved with the workbook. what could be done to a workbooks code to change this option upon opening the book?
I have a userform that prints out pages using a autofilter, the code in the userform prints out 13 different criterias from the autofilter. But the problem is i have no control over what criteria i can print out. Theres the
So i have design another userform that will able me to control what criteria can print out using checkboxes. But i don't know how to code the new userform so when i select a checkbox it removes that criteria from the code in the first userform called 'frmPrintOptions' and when deselect the checkbox it puts the criteria back in the code. Also the Second userform called 'frmAutoPrint' must remember what checkboxes have been selected and deselected.
I am currently having trouble getting =IF forumla's to work, with more than 3 options AND an equation being taken into account. Attached, is an example of a spreadsheet, involving what I currently have, with Row 5 showing the formula's I've used, and rows 2-4 showing examples of 'Yes', 'No' and 'Equal' outcomes.
For Column E, I would like the value from the above cell (set to zero in the formula of the first cell) to: -Go up 1 digit (from the above cell's value) for a Yes in that rows C cell -Go down 1 digit (from the above cells value) for a No in that rows C cell -Go up 2 digit (from the above cell's value) for a Equal in that rows C cell
As can also be seen from my example, I only have it working so that 'Yes' in C will take the value up by 1, and anything else (including 'No' and 'Equal') going down a point, which is only really using 2 options. I have tried numerous different possibilities for trying to get this to work, all of which gave me #VALUE error, or wouldn't even let me accept the formula. My current formula for what I have now (with only 2 options) is
=If(C5="Yes",E4+1, E1-1)
Basically, if possible, I would just like to make the E column change from 2 different ways (e.g +1 and -1) to 3+ different ways (e.g +1, +2 and -1).
I have a spreadsheet that I access over a citrix network, when I opened it at the start it gave me an option to enable or disable refresh external data, also enable or disable macros both of these are gone now and I have searched the net to find a way to get them back.
At the moment I have to click in the cell and then look at the cells used and look across to the title of the rows.
So for example, performance = D3*D4*D5*D6
I would like, performance = vehicles*availabliity*utilisation*TKM.
That is easy if I have just 1 option. But what if I have 3 options? Naming each cell would be a way to do it but pretty laborious, is there a 'smart' way to use named ranges here?
I have created a drop down list, but when selected the text is really small. I know this is because I am zoomed out, but if there any way for the text to be larger so that I can zoom out and still read what the options for the dropdown list are?
I have a table with a list of names of some products and their substances, firm, package and price.What I need to do is this. When I type a certain name in another sheet, I want it to show me a cell with the substances, a cell with the firm (that are fixed and cannot change them) and then in the next cell to give me options (if I type "package 1kg" to show me the price of this package, if I type "package 0,5kg" the price of this one, etc.).
For my school project, I must create a spreadsheet with lists. I am not allowed to have the data from the lists displayed anywhere on the sheet except for the results which will be hidden by the list (Combo box) in question. I have 3 such combo boxes and I need the options inside them to be hard coded into the spreadsheet. How do I do this?
I have a workbook (VBE.xls) that creates menu options in the VBE when it opens. Several of them modify the code in the active codepane.
When the codepane is in VBE.xls, everything gets reset and my macros don't run anymore. I have to re-run the macro (menu_setup()) that creates the menu options. I don't think there is anything I can do about it resetting when I modify the project that created the menus.
Is there some way to have each macro re-run menu_setup() AFTER it has ended (after the reset has cleared everything)?
I've tried having each macro open the immediate window and paste in "menu_setup" then tried to use "sendkeys" command to execute it, but I can't seem to get it work.
Having great success at using Countif and Sumif in totaling values across two sheets, but at the risk of sounding like a dummy I would like a suggestion as to which formula I should be using for this basic little function;
I have a column on a sheet with dropdowns offering 4 options; Active, Cancelled, Completed, and Suspended. I'm using Countif to total the number of "Active" but I also need to total the number of "Canceled", "Completed", and "Suspended" under the one heading, as if they all meant the same thing.
I know I can figure out the number of possible criteria using FACT(#) if it is just a number. But what if i want to figure out the number of passwords that can be used if the password must be 6 characters and have at least 1 number and at least 1 letter (so it could be any combination of up to 5 letters and 1 number, or 5 numbers and 1 letter). To make it more complicated, passwords are case sensitive. Just wondering about this since whenever I have to reset a password I always wonder how many possible passwords there are to choose from.
I followed a youtube video on setting up a survey in excel, and it works great, but it was only for two options. I wanted to make it 5 options per question, but when I started adding to the code ( which I thought was correct, but was not ) I kept getting errors. It probably is a simple addition. How to make the survey options more than two?
There are three tabs. The first tab (Start) only has a button that leads to the QA Survey. The Second tab has the questions and answers. The third tab as three columns in it as well for the name of the person, question number, and answer choice.
Here is the code inside the form (QASurvey):
Code: Private Sub button_next_Click() ''confirm there is a name If TextBox1.Value = "" Then MsgBox ("Please enter your name") [Code] ...
Here is the code in Module 1:
Code: ''global variables Public info() As Variant Public results() As Variant Public questionnumber As Integer
Here is the code on the sheet that has the button to start the Survey Form:
Code: Private Sub Start_Button_Click() QASurvey.Show End Sub
I'm trying to make a spreadsheet where in a column (Column B) you enter a value from 1 to 5 and then depending on the value the cell would turn red (1), yellow (2), green(3), blue (4) or grey(5). I had used conditional formatting for this type of function before but Excel 2003 only gives the option of three possible conditions on any given cell. I could give up one color (grey) and limit the number to four options, but it still is one more option than allowed.
I have the following VB macro that runs after user presses OK on a userform. I don't think it's written correctly. I would like a prompt that gives two options (either yes to return a null value if they've left a field blank, or return user to a reset userform1 if they select no.)
Private Sub CommandButton1_Click()
If Me.TextBox1.Value = "" Then MsgBox ("You Must Enter a Part Number (eg. 1007821-12)") Unload UserForm1 Calculate UserForm1.Show End If If Me.TextBox2.Value = "" Then MsgBox ("You Must Enter a Lot Number (eg. 6020631)")............