hello
i have this code works very well but i need adjusting and make it numbering every 4 rows i put my result in column a
HTML Code:
hello
i have this code works very well but i need adjusting and make it numbering every 4 rows i put my result in column a
HTML Code:
Hi ABDELFATTA
See if a For Next Loop with a 4 Step works for you. Like:
Sub Auto_Serial() Dim lr As Long Dim RowCtr As Long Dim PreStr As String Dim Ctr As Long lr = ActiveSheet.Cells(Rows.Count, 2).End(xlUp).Row PreStr = "bsj2018/" Ctr = 1 For RowCtr = 4 To lr Step 4 Cells(RowCtr, "A") = PreStr & Format(Ctr, "000") Ctr = Ctr + 1 Next RowCtr End Sub
One test is worth a thousand opinions.
Click the * Add Reputation below to say thanks.
Can you also indicate what the expected result is?
Another optionSub Abdelfattah() With Range("A4:A" & Range("B" & Rows.Count).End(xlUp).Row) .Formula = "=if(B4="""","""",""bsj2018/""&text(counta(B$4:B4),""000""))" .Value = .Value End With End Sub
awesome Marvip greatly work
always codes are unique fluff the most important no loop this makes code a quick thank so much
You're welcome & thanks for the feedback.
sir vragg i have ever cleared the result in column a do you check my file , and do you read my post ?
anyway Fluff and Marvip solved it
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks