Are There Standard Naming/coding Conventions For

Nov 13, 2009

Workbooks > Worksheets > VBAProjects > Modules

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).

View 9 Replies


ADVERTISEMENT

Naming Spreadsheet And Coding A Button

Apr 29, 2009

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.

View 4 Replies View Related

Multiple Rounding Conventions Per Row/column

Sep 8, 2008

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.

View 9 Replies View Related

VBA Coding

Mar 18, 2008

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.

View 9 Replies View Related

Coding Months

May 22, 2007

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

View 9 Replies View Related

Coding A Macro In VBA

Apr 3, 2008

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".

View 9 Replies View Related

Optimizing Coding

Jun 3, 2008

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....

View 9 Replies View Related

Lock Vba Coding

May 1, 2007

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"

View 9 Replies View Related

Dropdown Box Coding To Another Cell

Dec 24, 2012

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.

View 2 Replies View Related

Coding To Order Stock

May 8, 2014

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.

View 1 Replies View Related

Dynamic Range In Vba Coding

Nov 2, 2008

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.

View 6 Replies View Related

Coding Multiple Cases In VBA

Mar 24, 2009

I am writing VBA code to do the following:
IF A1 > 50 then print array C1:E7

I have this code and it works.

View 14 Replies View Related

Deactivate Coding Not Working?

Sep 3, 2009

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.

View 6 Replies View Related

Coding For Changing Worksheet Name

Oct 26, 2009

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.

View 5 Replies View Related

Using Index And Match In VBA Coding

Jun 3, 2014

I have table where i have to find a value based on 2 criterias. So i have used in Excel the below formula:

=INDEX($A$1:$D$7,MATCH(1,($A$1:$A$7=$F2)*($B$1:$B$7

View 1 Replies View Related

Can You Use VBA Coding To Sort By More Then 3 Criteria

Nov 28, 2006

I was wondering if there is a workaround for sorting in Excel by MORE THEN 3 CRITERIA?

I have seen a couple of solution doing 2 seperate sorts but was wondering if you can write code to expand on Excels limited sorting capabilities?

View 9 Replies View Related

Color Coding Formula

May 14, 2007

i'm trying to figure out a formula that if a cell is greater or equal to another cell - color a cell "GREEn"

otherwise...color the cell "red"

View 9 Replies View Related

Macro - Color Coding

Jun 13, 2007

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.

Here is another example:

T: TBD

And final example:

T: 6/4/07
RT: 6/15/07

View 9 Replies View Related

Vba Coding For A Simple Clock

Sep 15, 2008

where can I get vba coding for a simple clock.

I would like the clock to be digital rather than analogue if possible

View 9 Replies View Related

VBA Or Other Coding For Looking Up File Date

Dec 15, 2008

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.

View 9 Replies View Related

Colour Coding Cells

Jun 27, 2006

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.

View 6 Replies View Related

Most Efficient Coding Method

Apr 25, 2007

In each VBA book I've read the authors will write their code like this:

nStart = UBound(GenArray1)
nEnd = UBound(GenArray2)
Redim preserve NewArray(nStart To nEnd)

Instead of the less line method of:

Redim preserve NewArray(UBound(GenArray1) To UBound(GenArray2))

View 7 Replies View Related

Color Coding Cells With Vba

Feb 7, 2008

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.

View 9 Replies View Related

Naming The Tab

Apr 13, 2009

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

View 6 Replies View Related

Tab Naming

Sep 15, 2008

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: ...

View 9 Replies View Related

Coding To Arrange And Space Out Data Elsewhere

Apr 25, 2014

I have attached a work book to this to show what i want to do.

On sheet 'lorry 1'.

I have data in columns g to m.

I need that data to transfer to the lorry sheet as per example on sheet 'what it should look like'

It needs to segregate days and leave a line clear in between drops as per example

lorry 1.xlsx‎

View 4 Replies View Related

How To Change Coding In Macro For Pivot

May 9, 2014

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.

[Code] .......

View 2 Replies View Related

Why Some Macro Coding Put In Sheet And Some Put In Modules

Mar 18, 2014

I would like to know why some macro coding put in sheet and some put in modules?? What the different??

View 6 Replies View Related

Coding The Page Setup Efficiently

Mar 7, 2008

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?

View 10 Replies View Related

Coding A Formula On A User Form

Nov 8, 2008

Excel 2003

right now I have an Average formula on a worksheet and I pull that value to a user form with this:

View 2 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved