I want to make it so my if statement will work if the cell is not blank. Currently my if statement only works if the cell is equal to a specific value. In this case the value is ####
If Range("B" & i) = "####" Then
Worksheets("####").Activate
Sheets("####").Range("A" & (13 + ####Count)) = Sheets("Input").Range("AD" & i)
Sheets("####").Range("D" & (13 + ####Count)) = Sheets("Input").Range("P" & i)
Sheets("####").Range("E" & (13 + ####Count)) = Sheets("Input").Range("U" & i)
Sheets("####").Range("F" & (13 + ####Count)) = Sheets("Input").Range("O" & i)
Sheets("####").Range("G" & (13 + ####Count)) = Sheets("Input").Range("U" & i)
Sheets("####").Range("H" & (13 + ####Count)) = Sheets("Input").Range("F" & i)
Sheets("####").Range("I" & (13 + ####Count)) = Sheets("Input").Range("S" & i)
Application.CutCopyMode = False
####Count = ####Count +
So basically if range("B"&i) is not blank, do the copy and paste function, rather than only doing it when it is equal to a specific value.
If Range("B" & i) = "####" Then
Worksheets("####").Activate
Sheets("####").Range("A" & (13 + ####Count)) = Sheets("Input").Range("AD" & i)
Sheets("####").Range("D" & (13 + ####Count)) = Sheets("Input").Range("P" & i)
Sheets("####").Range("E" & (13 + ####Count)) = Sheets("Input").Range("U" & i)
Sheets("####").Range("F" & (13 + ####Count)) = Sheets("Input").Range("O" & i)
Sheets("####").Range("G" & (13 + ####Count)) = Sheets("Input").Range("U" & i)
Sheets("####").Range("H" & (13 + ####Count)) = Sheets("Input").Range("F" & i)
Sheets("####").Range("I" & (13 + ####Count)) = Sheets("Input").Range("S" & i)
Application.CutCopyMode = False
####Count = ####Count +
So basically if range("B"&i) is not blank, do the copy and paste function, rather than only doing it when it is equal to a specific value.
Last edited: