Emoncada
12-03-2013, 08:34 AM
I have the following code.
Sub Send()
Dim ColNext1 As Integer
Dim RowNext1 As Integer
Dim RowNext2 As Integer
Dim RowNext3 As Integer
Dim RowNext4 As Integer
'last row of data puls one row
ColNext1 = Worksheets("Wk Picks").Range("B1").End(xlToLeft).Column + 1
RowNext1 = Worksheets("Wk Picks").Cells(65536, 2).End(xlUp).Row + 1
RowNext2 = Worksheets("Wk Picks").Cells(65536, 2).End(xlUp).Row + 2
RowNext3 = Worksheets("Wk Picks").Cells(65536, 2).End(xlUp).Row + 3
RowNext4 = Worksheets("Wk Picks").Cells(65536, 2).End(xlUp).Row + 4
'Cells(Row Number,Column Number)
With Worksheets("Wk Picks")
If Teams.TxtAway.Value <> "" Then
.Cells(RowNext1, ColNext1) = "Sunday"
.Cells(RowNext2, ColNext1) = Teams.CmbTime.Value
.Cells(RowNext3, ColNext1) = Teams.TxtAway.Value
.Cells(RowNext4, ColNext1) = Teams.TxtHome.Value
End If
End With
End Sub
What i need is for this code to look at the next available column with no data a row 1 then transfer the data to the sheet.
This code is putting the data in Column B which is good since A1 has data, but it's putting the data in Row 20. It appears to be looking at Column A which has data down to row 19
I need for it to start from row 1. Then continue looking at next available column based on row1
What am i doing wrong?
Sub Send()
Dim ColNext1 As Integer
Dim RowNext1 As Integer
Dim RowNext2 As Integer
Dim RowNext3 As Integer
Dim RowNext4 As Integer
'last row of data puls one row
ColNext1 = Worksheets("Wk Picks").Range("B1").End(xlToLeft).Column + 1
RowNext1 = Worksheets("Wk Picks").Cells(65536, 2).End(xlUp).Row + 1
RowNext2 = Worksheets("Wk Picks").Cells(65536, 2).End(xlUp).Row + 2
RowNext3 = Worksheets("Wk Picks").Cells(65536, 2).End(xlUp).Row + 3
RowNext4 = Worksheets("Wk Picks").Cells(65536, 2).End(xlUp).Row + 4
'Cells(Row Number,Column Number)
With Worksheets("Wk Picks")
If Teams.TxtAway.Value <> "" Then
.Cells(RowNext1, ColNext1) = "Sunday"
.Cells(RowNext2, ColNext1) = Teams.CmbTime.Value
.Cells(RowNext3, ColNext1) = Teams.TxtAway.Value
.Cells(RowNext4, ColNext1) = Teams.TxtHome.Value
End If
End With
End Sub
What i need is for this code to look at the next available column with no data a row 1 then transfer the data to the sheet.
This code is putting the data in Column B which is good since A1 has data, but it's putting the data in Row 20. It appears to be looking at Column A which has data down to row 19
I need for it to start from row 1. Then continue looking at next available column based on row1
What am i doing wrong?