M
Marc Bell
Hello,
I've been trying for hours trying to get this right but i can't.
I have data in excel in the range v2 to ac25000. If a cell in v =
"unique", then I want data to be copied and pasted into a sheet called
journal starting at a blank line at A9 and incremently rising. The
code is a bit all over the shop but I just can't get the copy
destination part to work. Plemy forease help as head is bleeding from
the amount of times I've banged it against the wall. Thanks Marc Here
is the code:-
Sub wowwee()
Dim useme As Range
Dim cellw As Integer
Dim cellx As Long
Dim celly As Long
Dim cellz As Variant
Dim cellaa As Variant
Dim cellab As Currency
Dim cellac As Variant
Sheets("ANLC").Select
Range("v2:v25000").Select
For Each rngcell In Selection
If rngcell.FormulaR1C1 = "unique" Then
cellw = "2200"
cellx = rngcell.Offset(0, 2)
celly = rngcell.Offset(0, 3)
cellz = ""
cellaa = ""
cellab = rngcell.Offset(0, 6)
cellac = ""
If Sheets("journal").Range("A9") = "" Then
Set Target = Sheets("journal").Range("A9")
ElseIf Sheets("journal").Range("A9") <> "" And
Sheets("journal").Range("A10") = "" Then
Set Target = Sheets("journal").Range("A10")
ElseIf Sheets("journal").Range("A9") <> "" And
Sheets("journal").Range("A10") <> "" Then
Set Target =
Sheets("journal").Range("A9").End(xlDown).Offset(1, 0)
End If
'cant get this bit to work
Range(cellw, cellx, celly, cellz, cella, cllab,
cellac).Copy Destination:=Target
Application.CutCopyMode = False
End If
Next rngcell
End Sub
I've been trying for hours trying to get this right but i can't.
I have data in excel in the range v2 to ac25000. If a cell in v =
"unique", then I want data to be copied and pasted into a sheet called
journal starting at a blank line at A9 and incremently rising. The
code is a bit all over the shop but I just can't get the copy
destination part to work. Plemy forease help as head is bleeding from
the amount of times I've banged it against the wall. Thanks Marc Here
is the code:-
Sub wowwee()
Dim useme As Range
Dim cellw As Integer
Dim cellx As Long
Dim celly As Long
Dim cellz As Variant
Dim cellaa As Variant
Dim cellab As Currency
Dim cellac As Variant
Sheets("ANLC").Select
Range("v2:v25000").Select
For Each rngcell In Selection
If rngcell.FormulaR1C1 = "unique" Then
cellw = "2200"
cellx = rngcell.Offset(0, 2)
celly = rngcell.Offset(0, 3)
cellz = ""
cellaa = ""
cellab = rngcell.Offset(0, 6)
cellac = ""
If Sheets("journal").Range("A9") = "" Then
Set Target = Sheets("journal").Range("A9")
ElseIf Sheets("journal").Range("A9") <> "" And
Sheets("journal").Range("A10") = "" Then
Set Target = Sheets("journal").Range("A10")
ElseIf Sheets("journal").Range("A9") <> "" And
Sheets("journal").Range("A10") <> "" Then
Set Target =
Sheets("journal").Range("A9").End(xlDown).Offset(1, 0)
End If
'cant get this bit to work
Range(cellw, cellx, celly, cellz, cella, cllab,
cellac).Copy Destination:=Target
Application.CutCopyMode = False
End If
Next rngcell
End Sub