Excel
A family of Microsoft spreadsheet software with tools for analyzing, charting, and communicating data.
1,468 questions
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
hi
Private Sub tsmFillNumberMerged_Click(sender As Object, e As EventArgs) Handles tsmFillNumberMerged.Click
'Trying to (Fill Auto Namber) cells when they are merging
If Clipboard.GetText IsNot Nothing Then
Dim sttClip As String = Clipboard.GetText()
Dim spl1 As String() = Split(sttClip, vbNewLine)
Dim pStart As Integer = InputBox("Set Start At ? ", DefaultResponse:=1)
Dim sttResult As String = ""
For Each pLine As String In spl1
If pLine = "" Then
sttResult += vbNewLine
Else
sttResult += pStart & vbNewLine
pStart += 1
End If
Next
Application.DoEvents()
Clipboard.Clear() ' Sometimes it works randomly and sometimes it doesn't
Application.DoEvents()
Clipboard.SetText(sttResult) ' not Set On Clipboard
' MsgBox("Clipboard is Ready . Paste Into Excel .Copy the Pasted Values Again Then On the first Merged Cell Of the [Paste Option] Click On Paste Link")
End If
End Sub