geordie_ben
Board Regular
- Joined
- Jul 27, 2009
- Messages
- 122
I'm populating some files to import into another system
Here's the code so far. This is part of a bigger piece of coding
At the moment the cell content of C2 is "Sales"
Once the above has ran, I then need to set he next empty cell in C to "Purchases" and have the code repeat so that I end up with say 10 lines of Sales, and then 10 lines of Purchases. 10 is an example
If it makes it easier I could add the words Sales and Purchases into two separate cells on an different sheet
Here's the code so far. This is part of a bigger piece of coding
Code:
If Sheets("Nom Prod Dim Tag Legs").Range("A" & Rows.Count).End(xlUp).Row > 2 Then _ Sheets("Nom Prod Dim Tag Legs").Range("A3:A" & Sheets("Nom Prod Dim Tag Legs").Range("A" & Rows.Count).End(xlUp).Row).ClearContents
With Sheets("Nom Prod Dim Tags")
.Range(.Range("E2"), .Range("E2").End(xlDown)).Copy Sheets("Nom Prod Dim Tag Legs").Range("A2")
End With
With Sheets("Nom Prod Dim Tag Legs")
.Range("B2").AutoFill Destination:=.Range("B2:B" & .Range("A" & Rows.Count).End(xlUp).Row)
End With
With Sheets("Nom Prod Dim Tag Legs")
.Range("C2").AutoFill Destination:=.Range("C2:C" & .Range("A" & Rows.Count).End(xlUp).Row)
End With
With Sheets("Nom Prod Dim Tag Legs")
.Range("D2").AutoFill Destination:=.Range("D2:D" & .Range("A" & Rows.Count).End(xlUp).Row)
End With
At the moment the cell content of C2 is "Sales"
Once the above has ran, I then need to set he next empty cell in C to "Purchases" and have the code repeat so that I end up with say 10 lines of Sales, and then 10 lines of Purchases. 10 is an example
If it makes it easier I could add the words Sales and Purchases into two separate cells on an different sheet
Last edited: