M
musa.biralo
Hi there,
The code below takes a bit time to populate the ID if I select bigger
range....Is there any way to expedite it.
Any help will be appreciated!!!!
Dim DataCell As Range
Dim TotalData As Integer
Dim Counter
Response2Msg = MsgBox("Did you select the range of cells to insert the
IDM ID?", vbYesNo, "Select required range?")
If Response2Msg = vbNo Then End
i = 1
For Each DataCell In Selection
TotalData = Selection.Rows.Count
If TotalData < 10 Then
Counter = Format(i, "0")
ElseIf TotalData >= 10 And TotalData < 100 Then
Counter = Format(i, "00")
ElseIf TotalData >= 100 And TotalData < 1000 Then
Counter = Format(i, "000")
ElseIf TotalData >= 1000 And TotalData < 10000 Then
Counter = Format(i, "0000")
ElseIf TotalData >= 10000 And TotalData < 100000 Then
Counter = Format(i, "00000")
End If
DataCell.Value = "MUSA_" & Counter
i = i + 1
Next DataCell
The code below takes a bit time to populate the ID if I select bigger
range....Is there any way to expedite it.
Any help will be appreciated!!!!
Dim DataCell As Range
Dim TotalData As Integer
Dim Counter
Response2Msg = MsgBox("Did you select the range of cells to insert the
IDM ID?", vbYesNo, "Select required range?")
If Response2Msg = vbNo Then End
i = 1
For Each DataCell In Selection
TotalData = Selection.Rows.Count
If TotalData < 10 Then
Counter = Format(i, "0")
ElseIf TotalData >= 10 And TotalData < 100 Then
Counter = Format(i, "00")
ElseIf TotalData >= 100 And TotalData < 1000 Then
Counter = Format(i, "000")
ElseIf TotalData >= 1000 And TotalData < 10000 Then
Counter = Format(i, "0000")
ElseIf TotalData >= 10000 And TotalData < 100000 Then
Counter = Format(i, "00000")
End If
DataCell.Value = "MUSA_" & Counter
i = i + 1
Next DataCell