PDA

View Full Version : Excel macro for +1


dragster1090
Mar 15, 2013, 12:14 PM
I need to create a macro or formula for excel. I have a number in cell A2 and a information in cell B2. I need to create a macro or use a formula that when I enter information in cell C3 that will auto populate cell B3 with a number that is +1 from cell B2. For clarity, please see below:


CELL CELL
A = 1234 B = 650-0001
row 2 = # needed C = 650-0002
row 3 = # needed C= 650-0003

JBeaucaire
Mar 15, 2013, 10:39 PM
1) Highlight column B and press CTR-1 to open the Format cell window

2) Apply a Custom format of 000-0000

3) Now enter this number in B2: 6500001 (notice the dash is missing when you type it)

4) B2 will now show in the format you noted: 650-0001

5) In B3, enter the following formula:

=IF(A3<>"", B2+1, "")

6) Copy B3 downward



If I have misconstrued the actual cells where you need things, just wrap your head around the cell format trick and the formula trick, and apply that to where you DO need it.

ComputerExpert1
Mar 16, 2013, 06:03 AM
Click the cell in which you want to enter the formula.
In the formula bar Formula bar, type = (equal sign).
Do one of the following:
Cell reference To create a reference, select a cell or range of cells on the same worksheet.

Cell references and the borders around the corresponding cells are color-coded to make it easier to work with them.

Range Finder color-codes precedent cells
Callout 1 The first cell reference is B3, the color is blue, and the cell range has a blue border with square corners.
Callout to the second cell reference is C3, the color is green, and the cell range has a green border with square corners.

You can drag the border of the cell selection to move the selection, or drag the corner of the border to expand the selection.

Defined name To create a reference to a defined name, do one of the following:
Type the name.
Press F3, select the name in the Paste name box, and then click OK.

Note If there is no square corner on a color-coded border, the reference is to a named range.

Do one of the following:
If you are creating a reference in a single cell, press ENTER.
If you are creating a reference in an array formula, press CTRL+SHIFT+ENTER.

added a photo of what this formula should look like