I know that I can use my own best judgment to devise a consistent naming system, but I want to know if there is a community standard already.
I typically use the RVBA conventions for variable/object naming, but there doesn't seem to be a provision for the items above?
In keeping with the convention, I figured wkb and wks handles the 1st 2 (unless you all specify otherwise), but I have seen a few for projects and modules:
Projects: vbaProject, prjProject
Modules: MModule, modModule, basModule
Additionally, RVBA calls for CamelCase to be used to name Subs and variables, but I have been using a mixture of Caps and Underscores for these other items, whether it be the Customer or Code Name (I capitalize Functions to make them seem native).
I have a macro attached on Sample 01 that outputs a couple files after a certain date. The problem is the date that it choses is always "todays" date and I want to be able to change the date, the cell that I need to be able to change is cell c2. The problem is the rest of the formulas in the cells change to number format and don't stay in date format.
how to add code to a button. I think I've more or less solved my own problem with merging the data of two spreadsheets together (not as cleanly as I'd like of coarse), but the problem is the person I'm going to train to use this spreadsheet is not very computer savvy and this needs to be as easy as possible. So I want them to just be able to click 3 buttons and be done with the process.
I am working on a 1000+ cell spreadsheet that contains ~ 20 different formulas in randomly distributed cells. The the final values range from approximately 3,000,000 to 0.000000005. I need to round the products of these formulas to the nearest whole number or the first significant digit to the right of the decimal. Is there a way that this can be done without editing every cell? I am trying not to disturb the cells as that is where mistakes were made in the past.
I am trying to code a macro to run down through a column and hide the row if it finds a cetain marker (i.e. the letter "n") in the column, and then move onto the next one.
My spreadsheet calculates the date on a daily basis.
I would like to create a code in my spreadsheet which uses the year and month in question.
First, 2006 is is designated as a "3" 2007 "4" 2008 "5" 2009 "6" etc
Don't worry about anything prior to 2006.
Next, the months are represented by single digits. So, January = 1, February = 2, March = 3, April =4, etc. September is 9, and October = 10 but all the numbers over 9 have to be reduced to a single digit, so October = 1+0=1, November =1+1= 2, December =1+2= 3.
Now, the formula for the Month is:
Year + current Month
So, May 2007 = 4 + 5 = 9 June 2007 = 4 + 6 = 10 = 1 July 2007 = 4 + 7 = 11 = 2, January 2008 = 5 + 1 = 6, etc
Is there a way of coding a macro in VBA that allows you, with one macro, to enter text in one cell and at the same time enter a value to the cell on it's right?
I don't want to name the cells, but I wondered if you could add to the code a piece of code that basically said "Select the cell to this cell's right and add the value x".
I have made this vba to go out and look at 2 different locations which contain simular folder names.
The script then writes the folder names in Column A, followed by the Size of both the folders from the 2 locations. The script is comparing the second location folder name to what the first process put in Column A so the folder names will be aligned with the file sizes. It is also converting the file sizes from bytes to the most appropriate one.
The problem I am having here, is once I put the second part in for the second folder, the script is either taking forver (More than an hour) or is freezing. So I am not sure if I put it in a loop somewhere or what exactly is happening. I am just wondering if I can get some help troubleshooting and optimizing this code....
How it is possible to lock the VBA coding and Modules? I mean when Some one want to view VBA coding the Password window should not appear, istead of that a message box appears with message something like "Not viewable"
I have a drop down box with the 10 different shifts we run here at my work. Ie - Daytime (0700-1500), Nightime (1500-2300) etc. I have these on a drop box as stated earlier (Cell 6) - and want to code a selection from within the box, to effect Cell 7 with the approriate hours worked depending on what I selected in Cell 6.
I am looking to create coding that once stock gets to a particular level a text box pops up to alert the user that more stock needs to be ordered and ideally I would like once the user selects ok for it to take them directly to the appropriate email template.
However, I don't want the text box to come up while we are waiting on the stock to be ordered.
i.e our current minimum stock level before placing our next order is 10,000 units. Order is placed and can be received within 10 - 14 days. During this time our 10,000 units will be used but I don't want an alert to pop up to remind the user to place an order as this action will already have been carried out.
I'm trying to write a code which would place formulas in the row just below the my range (normally a matrix of figures) to sum the column in that just above that. Here's what I've got so far but it doesn't work.
I have placed the following code in my spreadsheet but it's not working!
the code after option explicit (now at the bottom) works, (thanks to Andy on here!) but all the disabling the right click and cut/copy/paste etc doesn't.
when the accounts exported to excel, all the tabs shown in the file are generated. However, i need to change tab '3' to tab '10' name to the name stated in tab 'menu'. eg tab 1 need to be renamed as 'BB' (not BB/Bunut), tab 2 to 'GEN' (not GEN/General), etc. All must be capital letter.
I am trying to figure out how to run a macro for 1 particular workbook in an excel spreadsheet. I don't want it run on any of the other workbooks in that file, just the 1. I can't use conditional formatting because I need more than 3 values (if statements).
This is what one example of data in a cell and below is the color I'd like it to turn when I run the macro:
T: 6/1/07 A: 6/8/07
Anything that has a A: (which means an actual date it happened) I'd like the cell to turn blue. If there is an RT: (which means revised target) I'd like the cell to turn red which means it missed it's target date, and has been revised. If it has a TBD I'd like the cell to turn pink (or yellow or any color really). All other cells are just white. I don't know where to find the color codes in excel as well. Other samples of what cells look like are below.
I am trying to learn how to use it in some of my Excel application. I am just wondering if someone would be willing to help what I am thinking would be a short string of code.
What I have is a list of files that I have compiled along with a name and description in cells B3 and C3 respectively. In cell E3 what I have is the path to that file which is linked so that I can click on it to access the file. Is there any way that I can write some kind of simple code to look up the last modified date of that file whose path is specifed and place it in cell D3.
Is it possible to select a number of cells that are say yellow when blank but once someone type "N" or "No", they change to blue and if "Y" or "Yes" they change to green. I tried conditional formatting but it does not change the blank range to yellow until I have entered something into it.
I have a spreadsheet with cells containing different names. I want all of the cells containing the word Volitility to be colored one color, all of the cells with the word Momentum colored another color, and so on. I have more than three names so I cannot use conditional formatting. Attached is a workbook that has the uncolored cells in worksheet 1 and an example of what I want it to end up looking like in worksheet 2.
on sheet 1 which is named front cover i want to type in cell C8 a number or a name and it will change sheet 2 tab to what i type i have 20 sheets to do i can get it working in b5 on same sheet but i need it to work from the front cover sheet
My workbook has a summary page and one page for every day of the month. I am making a template file, so I can duplicate it to use every month of the year.
Each week is separated by a worksheet titled "week 1", "week 2" , etc. This is used in the summary page so I can gather totals for a week.
What I want to be able to do is this:
On the first day of the new month, go to week one and type in the date. Then that sheet tab would equal the date, and each daily tab name thereafter would increment the appropriate amount (1day). Then on week 2, it would be equal to the tab value for Friday +3.
The problems I see are:
1. In week 1 the month can start on any on of the 5 worksheets I have set up to cover the week. So any first day coding I need may have to be repeated in the first 5 worksheets
Is this do-able? 2. Tab naming code I have found on this site is not working for dates. 9-15-08 typed into a1 will not translate into the tab, even tho it is a valid name. I am using code VoGII gave which follows: ...
I'm trying to run a pivot in Macro where the Pivot needs to choose the whole sheet and not a specific range as the data pasted in the sheet may fall in different range or rows however the columns are stable.,
Below given is the coding for that Macro Recording for Pivot.
I've managed to clean up my code removing all of the selecting to get the macro to run faster but it seems to slow down when it gets to the page setup. Is it because of the ActiveSheet? Is there a better way to code the following?