C
Casey
Hi,
I posted this question yesterday and got a response, however, I hav
tried all day to get this to work but still get the error 1004. I a
all out of ideas, could use some help.
I just need to be able to set the CopyCol value = to the first empt
Cell to the right of the single Cell named range "StartCell".
Here is the code.
Private Sub cmdEnterSelection_Click()
Dim rng1 As Range
Dim i As Long
Dim j As Long
Dim CopyCol As Long
Set rng1 = Sheets("Takeoff").Range("TakeOffHeaders")
CopyCol = Sheets("Takeoff").Range("StartCell").End(xlToRight).Offset(0
1).Column'<<<<<<<<<<<ERROR HITS HERE
For i = 0 To Me.ListBox1.ListCount - 1
If Me.ListBox1.Selected(i) Then
With rng1
.Cells(1, CopyCol).Value = ListBox1.List(i, 0)
.Cells(4, CopyCol).Value = ListBox1.List(i, 1)
.Cells(5, CopyCol).Value = ListBox1.List(i, 2)
.Cells(6, CopyCol).Value = ListBox1.List(i, 3)
End With
CopyCol = CopyCol + 1
End If
Next i
OptionButton2.Value = True
End Su
I posted this question yesterday and got a response, however, I hav
tried all day to get this to work but still get the error 1004. I a
all out of ideas, could use some help.
I just need to be able to set the CopyCol value = to the first empt
Cell to the right of the single Cell named range "StartCell".
Here is the code.
Private Sub cmdEnterSelection_Click()
Dim rng1 As Range
Dim i As Long
Dim j As Long
Dim CopyCol As Long
Set rng1 = Sheets("Takeoff").Range("TakeOffHeaders")
CopyCol = Sheets("Takeoff").Range("StartCell").End(xlToRight).Offset(0
1).Column'<<<<<<<<<<<ERROR HITS HERE
For i = 0 To Me.ListBox1.ListCount - 1
If Me.ListBox1.Selected(i) Then
With rng1
.Cells(1, CopyCol).Value = ListBox1.List(i, 0)
.Cells(4, CopyCol).Value = ListBox1.List(i, 1)
.Cells(5, CopyCol).Value = ListBox1.List(i, 2)
.Cells(6, CopyCol).Value = ListBox1.List(i, 3)
End With
CopyCol = CopyCol + 1
End If
Next i
OptionButton2.Value = True
End Su