I have a worksheet that uses the INDIRECT function as part of cell validation to generate a custom 'name' range, this name then references a bunch of sheets that contain the actual range where the values for the validation list are stored. For example: ValidationExample.xlsx
Name = Color Values = Blue, Red, Green
Name = Shape Values = Square, Circle, Triangle
So what this allows me to do is in the first cell, I can define two options such as Color and Shape. Once one of these is selected, the next cell will have a formula for the validation as "=INDIRECT(A1)" then I will define two named ranges called 'Color' and 'Shape'. This will then show me the list of items in the cell based on previous selection. An example of this is attached to this posting above.
When the formula is written into the validation, an error message is generated saying that the formula will generate an error. Even with this message, the method works effectively to provide a blank list if nothing in the first cell is selected, or a list dependent on the selection of the first cell.
In this case, what I want to do is generate a macro that will populate the validation for a cell when new records are added. This won't always copy down from previous cells because the way I add records is through use of a macro and I generally find using the format painter in vba to be a fairly sloppy way of getting formats from other cells. So I go through a series of validation additions to each cell in the worksheet to get this validation created (I have no written this into the workbook attached).
VB: Dim i As Long Dim lastRow As Long Dim sht As worksheet
As I read in previous posts, Formula1 cannot contain an actual formula, only names and lists of items. Since each of the cells will have a changing reference, thus the INDIRECT function would need to change to reflect this, The 'Secondary' name consists of the following:
Which of course does not work due to the error when using INDIRECT in the first place (though the Address() function appropriately finds the cell with the validation in it's appropriate address). I can think of other ways to do this, such as having validation lists change in with VBA on a SelectionChange or Change event, but that's a lot of code that is subject to change when the named ranges have changes to them (which is fairly frequent). Is there any way to get the .Validation.Add method to ignore errors in the name supplied to it.
For reference, my code is this:
VB: Private Sub cmdRefreshValidation_Click() 'Re-enters validation parameters to all cells to allow selections Dim i As Long Dim lastRow As Long Dim sht As Worksheet
How would I create a shortcut to automatically copy the contents of cell H1 to cell K1, in other word I would like to hit a shortcut key and have the contents of that cell pasted 3 cells to the right on the same line. I have to do this over and over again down the worksheet. I am working on taxes and want to copy values over to the expenses column as I find them.
I would also like to know if it is possible while having cell D1 highlighted I could have a shortcut created that would copy the value three cells over in H1 to cell K1. That would be the fastest, but I don't know if it is possible?
I am creating a helper table so then I can graph my information. But the formula I am using gives me the information. The problem is it skips the first row for every school. So when I select the school's name from the drop down menu in the schools dashboard sheet. The table should update with the grade level.
For example; I select school 1 which has grade 3, 4, & 5. but when I look at the helper table what comes up is grade 4 and 5. the formula I am using is
I am creating a custom autonumber in excel. The autonumber will be based on the value of another cell's value. So for eg, in cell A1 will look at B1, if B1 has the number 1, A1 will take B1 and add the autonumber to it, eg a, b, c.
If within, b5 the number is 2. So if the number in the corresponding row in b changes, the autonumber must restart.
I've decided to go with a-z for the autonumber as i realized for .1, .2, .3 is limited to 9 values in the list bec. 1.10 may be read as 1.1
I've tried a few options such as creating a named range, however the problem is getting the autonumber to restart.
Below is what i want to achieve via excel formula:
create a formula using the COUNTIF function? I have a number in cell C1 and then numbers from C3:C65. I would like to produce a number count of how many items from c3:c65 are less than the value in c1 which is 24.
I'm trying to make a converter between about 8 various types of values. These are not units like Km or miles or something like that, but rather numbers that represent a specific "hardness value" on a variety of scales (to name a few: HRC, HRA, K)
What I've been doing so far is plotting the two types against eachother and then getting the best trendline I can so that I can use that formula to convert between the two with relative certainty. (for example, when plotting HV vs HRC my fourth order polynomial trendline with an Rsquared of 1 is y=0.0001x4 - 0.0188x3 + 1.0768x2 - 20.709x + 350.69)
My questions comes up where I was hoping to make a window or box of some sort allowing the user to input a numeric value, then selecting the Input units and the hopeful output calculated units, and have the box spit back to the user the conversion.
I am working on an exported database and need to make the first 2 words only PROPER. Do you have to use the helper cell ? Also, I practiced with the LEFT, RIGHT commands using the FIND on the spaces. It worked well. And I can extract the first word and make it proper in a helper cell. But I couldn't seem to add the PROPER function to the extract formula string. Would you add it first ?
Below are 2 of the "strings" that I am working on to make the first 2 words proper and then to subsitute the P/N to #.
I was reviewing the "Create Custom Menu Items in Excel VBA" code located at [url] and cannot figure out something. How do I add a menu dropdown that contains MORE than one submenu item? This is the code my question pertains to: ...
I am trying to create a custom sort list by going to preferences/custom lists and typing 37 items into a new list in Excel. It will not take all of the items after I type them in. Is there a limit as to how many items can be in the list. It seems to only take 18-20 items out of the 37 and erases the rest.
I am trying to create custom sort list. It works below when I define range as A1:A79.
Sub SortWS2() Dim SortOrder As Variant Dim sheetsorder As Range Dim Ndx As Long Application. ScreenUpdating = False With Worksheets("Sort Order").Range("A1:A79") For Ndx = .Cells.Count To 1 Step -1 Worksheets(.Cells(Ndx).Value).Move before:=Worksheets(1) Next Ndx End With Application.ScreenUpdating = True End Sub
I have created a dynamic range called sheetsorder. If I revise my code it does not work.
I have created an Addin from one I found on this site which creates a menu on the CommandBar. On this menu I can add my Macros. The Menu is initially supposed to perform a delete function then an add, just in case the menu already exists on the CommandBar. It is also supposed to Uninstall the menu when you de-select the Addin. At the moment it doesn't seem to be doing either, as I have now got 5 CommandBar menu's all the same and I can't delete them?
This also creates a problem of when I add another macro, the menu on the CommandBar doesn't update with the addition?
I have attached the .xla file for you to look at and see where I'm going wrong.
I get a lot of spreadsheets that I need to do an ascending sort on certain columns, but the problem is there is nothing to revert it back to its original sort. Is there a way to add a reference column numbered 1, 2, 3 etc. so i can return to the original order. The spreadsheets can be over 200 lines at times so doing it manually is really irritating.
It doesnt have to be too smart, just something to add a column and add the numbers say 1 - 1000 in ascending order, I can delete the excess as required. I know I could record a macro but that just seems to time consuming to go up to 1000.
how I can create a custom mask that will always put a / at the start of each cell in column C. So basically when I enter a number in, say 350, the mask will automatically put a / in front of it - /350 or even better /space350. The only issue is that the number will change in length a little, so not sure if this is a problem or not.
I have an Excel sheet with a long list of data. A short example is shown below:
Section | Title | Item 1 | INTRODUCTION | a 1.1 | title2 | b 1.2 | title3 | c 1.2.1 | title4 | d 1.2.2 | title5 | e
I made a VBA macro in Excel that runs through this list and creates a new Word file for each item. The filename of the document is based on the data in the Excel file (section and title). Now I would like to add a custom property to each of the newly created Word files, i.e. the value in the 'item' column. Does anyone of you know how I should do this? Or should it be better if I write a macro in Word that runs through the Excel data to create the word files? Here is the code I use to generate the word files:
I'm looking to create a new file from data in my table. I don't want to even imagine having to do this manually again...I'm optimistic there is a solution. All the data needed to create the file is in the table, but i need it stacked and organized in a weird way. It's almost to hard to explain...so I color coded an attachement that basically says it all. It's pretty much the same thing repeated over and over except the last 2 lines. It's just a really messed up organization. In the real version I need the new file in a new workbook. I'm extremely grateful to anyone who can automate this thing
I am needing to create a sequential serial number using a format yyyy-nnn, where yyyy is the current year and nnn is a sequential number (2007-001). I've tried using both a formula and custom formats but cannot get the cell contents to display as desired. I've used TODAY()&"-"&"001", which gives a valid result of 39100-001, but this not what I need. I've tried many other combinations in the custom option for formatting the cell.
I tried to create a custom menu for a specific file. However, after creating the menu, I posted the file in Sharepoint. When a user download the file from the sharepoint site, the custom menu doesn't work because it is looking for the macro links from my computer. Another problem is that now the custom menu shows up in all other excel files that I open.
My questions are: 1. How do I do it so that the custom menu shows up only when this file is opened up. 2. How do I go about making the menu to look for the macros embeded in the file itself instead of looking for it in my file folder.
I'm using Excel 2007 and have an Employee Scheduling Program that keeps track of 10 employees on a monthly basis (1 worksheet per month). The days of each month are in columns (I thru AM) and my 10 employees are in Rows 6 thru 15, which creates a grid of cells. I use Conditional Formatting to highlight the Weekends, Todays Date, and Holidays. My Sumproduct formula (shown below) is in each of the cells of my grid and places a number (1 to 10 for each employee) from start date to the end date. My Current formula works great as it finds every occurrence of the argument but I need to modify it to include the contents of the Helper Column.
I've written a ton of VB macros that do various things to a raw data sheet. I want now to create a custom menu (in the the menu ribbon bar at the top of the screen). I'd like this menu to be used to activate the various macros for whoever has my add-in.
I've found several examples on how to create an add-in, and creating custom menus, however they all for when someone opens a workbook with the code, and then they remove the custom menu when the workbook is closed. I would like my custom menu to stay on the users ribbon bar no matter what workbook they have open. The only time the custom menu should not appear is if the user removes the add-in.
I am trying to find expected proportion of code per country by looking at current values. I have a list of countries and associated classifications (0-5) with counts, similar to as follows:
Country code count
USA 1 65465
USA 2 54651
USA 3 65411
I am interested in creating a pivot table with the average of each code as a proportion of each country. The final table would be expected proportion of codes. The pivot table for this set would look like this:
Row Labels Average
Mean per code of the proportion of code per country