Sir Phoenix
10-05-2005, 03:09 PM
I'll post the code first here:
Private Sub addMe()
Dim schedFound, schedCell, schedRange As Range
Dim schedCount As Integer
Dim schedName As String
With ThisWorkbook.Sheets(4)
Set schedRange = .Range("a2", .Range("a65536").End(xlUp))
Set schedFound = schedRange.Find(Me.cmbSchedName.Value, MatchCase:=True)
End With
If schedFound Is Nothing Or Me.cmbSchedName.Value = "" Then
schedCount = 1
For Each schedCell In schedRange
If Left(schedCell.Text, Len(cmbSchedType.Value)) = schedCell.Text Then
schedCount = schedCount + 1
End If
Next schedCell
With ThisWorkbook.Sheets(4)
schedName = "" + Me.cmbSchedType.Value + schedCount
.Range("a" & schedRange.Count + 1).Value = schedName
It's erroring when I try to assign the value of the combobox concatenated with an integer to a string. I want to take this string and assign it to a cell, which I'm fairly sure will work once I can concatenate them correctly.
Thanks for all help!
Private Sub addMe()
Dim schedFound, schedCell, schedRange As Range
Dim schedCount As Integer
Dim schedName As String
With ThisWorkbook.Sheets(4)
Set schedRange = .Range("a2", .Range("a65536").End(xlUp))
Set schedFound = schedRange.Find(Me.cmbSchedName.Value, MatchCase:=True)
End With
If schedFound Is Nothing Or Me.cmbSchedName.Value = "" Then
schedCount = 1
For Each schedCell In schedRange
If Left(schedCell.Text, Len(cmbSchedType.Value)) = schedCell.Text Then
schedCount = schedCount + 1
End If
Next schedCell
With ThisWorkbook.Sheets(4)
schedName = "" + Me.cmbSchedType.Value + schedCount
.Range("a" & schedRange.Count + 1).Value = schedName
It's erroring when I try to assign the value of the combobox concatenated with an integer to a string. I want to take this string and assign it to a cell, which I'm fairly sure will work once I can concatenate them correctly.
Thanks for all help!