Hello,
I have a userform that contains a lot of controls
One of them is "cmdSubmit" that contains many actions (I finished them all instead the following)
I already have piece of code that copy a range and paste it in sheet2 (this range contains (Name, ID, ...)(Doesn't contain the Number)
ex: I copied the range and pate it in sheet2 B4 (using the code below)
What I missed is:
A piece of code to inset the Number in Column "A" Row (Depends on the name count)
A4, A5, A6 should be (Sheet3.Cells(Rows.Count, 1).End(xlUp).Value + 1) ex: 234
I tried the following code but I got an error
I need your help please and many thanks in advance
Sheet2
<tbody>
</tbody>
I have a userform that contains a lot of controls
One of them is "cmdSubmit" that contains many actions (I finished them all instead the following)
I already have piece of code that copy a range and paste it in sheet2 (this range contains (Name, ID, ...)(Doesn't contain the Number)
ex: I copied the range and pate it in sheet2 B4 (using the code below)
Code:
ws.Range("DailySales_SalesList").Copy
With Sheet2.Cells(Rows.Count, 2).End(xlUp).Offset(1, 0)
.PasteSpecial xlPasteValues
.PasteSpecial xlPasteFormats
Application.CutCopyMode = False
End With
What I missed is:
A piece of code to inset the Number in Column "A" Row (Depends on the name count)
A4, A5, A6 should be (Sheet3.Cells(Rows.Count, 1).End(xlUp).Value + 1) ex: 234
I tried the following code but I got an error
Code:
Set c = ws.Range("I:I").Find(What:=Me.txt_Name1.Value, LookIn:=xlValues)
a = Sheet2.Cells(Rows.Count, "A").End(xlUp).Row
For i = 1 To Application.WorksheetFunction.CountIf(ws.Range("I:I"), c)
a.Offset(i, 0) = Sheet3.Cells(Rows.Count, 1).End(xlUp).Value + 1
Next i
I need your help please and many thanks in advance
Sheet2
A | B | C | D | |
1 | Number | Name | ||
2 | 222 | Pop | ||
3 | 222 | Pop | ||
4 | Adam | |||
5 | Adam | |||
6 | Adam |
<tbody>
</tbody>