Hi,
I am new to VBA coding. What I am wanting to do is to transfer Names(Row B7:B160) to a different work sheet IF the Row next to it(C7:C160) is filled out with a time. I will be setting up a command button that once say 10 names have times next to it, this data then will transfer to another work sheet.
I have done below coding, however it will only transfer data in B7 and C7, if I try to add B7:B160 it comes back as Missmatch. Below is what I have done for the Command button. Please can anyone help me with this. Thank you in advance Winston
Private Sub CommandButton1_Click()
Dim AdviserName As String, Time As Integer
Worksheets("Sheet1").Select
AdviserName = Range("B7")
Time = Range("C7")
Worksheets("Sheet2").Select
Worksheets("Sheet2").Range("F5").Select
If Worksheets("Sheet2").Range("F5").Offset(1, 0) <> "" Then
Worksheets("Sheet2").Range("F5").End(xlDown).Select
End If
ActiveCell.Offset(1, 0).Select
ActiveCell.Value = AdviserName
ActiveCell.Offset(0, 2).Select
ActiveCell.Value = Time
Worksheets("Sheet1").Select
Worksheets("Sheet1").Range("C6").Select
End Sub
Bookmarks