I have practically no experience with coding in general, and have been watching videos on youtube to try and write a few codes. I have a "Master" sheet with a bunch of data, and I need to take that data and transfer it to each consecutive sheet based on the date. So all data with nov 17 to sheet 3 and all data from nov 18 to sheet four and so on. The issue I encounter is when I try to cycle through to the next date.
Option Explicit
Sub Copypaste()
'Sets a as variable for number of rows from master sheet
a = Worksheets("Master").Cells(Rows.Count, 1).End(xlUp).Row
For i = 2 To a 'Loops from i=2 to end
k = 3 'sheet number
J = 43048 'date
If Worksheets("Master").Cells(i, 1).Value = J Then
Worksheets("Master").Rows(i).Copy
Worksheets(k).Activate
'counts rows in sheet pasting to
b = Worksheets(k).Cells(Rows.Count, 1).End(xlUp).Row
'pasts to next blank row
Worksheets(k).Cells(b + 1, 1).Select
ActiveSheet.Paste
Worksheets("Master").Activate
Else
k = k + 1
J = J + 1
End If
Next
End Sub