# incrementing by 1

L

#### Legacy 4302

##### Guest
hi

For Each cl In [Sheet2!A1:C5]
tmpvalue = cl.value
if tmpvalue = 0 then tmpvalue=10
Worksheets("SHEET3").Cells(tmpvalue, cl.Column) = "1"
Next cl

this formula works great. Sheet 2 column A has: cell a1=2,cell a2=4,and cell a3=0 then sheet 3 column A has: a2="1", cell a4="1" and cell a10="1"
which is correct however the problem is if sheet 2 column a has:
cell a1= 3,cell a2=3 ,and a3=4
then sheet three column A should be cell a3="2" and cell a4="1"

so in other words if sheet 2 has duplicating numbers in the column then
for each instance of a duplicate number ,cl.value would have to be incremented by 1

thanks for any help

lneilson

### Excel Facts

Pivot Table Drill Down
Double-click any number in a pivot table to create a new report showing all detail rows that make up that number

Replies
33
Views
756
L
Replies
8
Views
394
Legacy 352679
L
Replies
17
Views
872
Replies
9
Views
123
Replies
10
Views
604

1,214,769
Messages
6,121,436
Members
449,032
Latest member
egspen2

### We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.

### Which adblocker are you using?

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

### Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

### Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back