kris.small
New Member
- Joined
- Jul 13, 2011
- Messages
- 12
okay so i have:
Sub Copy_If_2()<?xml:namespace prefix = o ns = "urn:schemas-microsoft-comfficeffice" /><o></o>
Dim lngNextDestRow As Long<o></o>
Dim rngRowItems As Range, c As Range<o></o>
<o></o>
With Worksheets("Master input table")<o></o>
If .Range("R6:R500, Arrests").Value = True Then<o></o>
Set rngRowItems = .Range(" ")<o></o>
End If<o></o>
With Worksheets("Arrests")<o></o>
lngNextDestRow = .Cells.Find(What:="*", after:=.Range("A1"), _<o></o>
SearchOrder:=xlByRows, SearchDirection:=xlPrevious).Row + 1<o></o>
For Each c In rngRowItems<o></o>
.Cells(lngNextDestRow, c.Column) = c.Value<o></o>
'c.ClearContents 'option to "move" instead of copy<o></o>
Next c<o></o>
End With<o></o>
End With<o></o>
<o></o>
Set rngRowItems = Nothing<o></o>
Set c = Nothing<o></o>
End Sub
im not sure it it's possible to get it to do something like this.
if R6 , Arrest = true, then Copy A6,B6,C6,D6,R6,S6 to sheet "Arrests".
but i need it to do that for every Colume in R if it = Arrests
basiclly in Colum R i have 5 different avalible entries, each one needs to be moved to a different sheet, arrests, discharge, admit, called off, Transport.
QUESTION
how do i get my macro to copy A,B,C,D,E,F,G(6) if R6 = _____ (arrest in this case)
dont know if it helps by my work is old school and working with 2003 excel.
Sub Copy_If_2()<?xml:namespace prefix = o ns = "urn:schemas-microsoft-comfficeffice" /><o></o>
Dim lngNextDestRow As Long<o></o>
Dim rngRowItems As Range, c As Range<o></o>
<o></o>
With Worksheets("Master input table")<o></o>
If .Range("R6:R500, Arrests").Value = True Then<o></o>
Set rngRowItems = .Range(" ")<o></o>
End If<o></o>
With Worksheets("Arrests")<o></o>
lngNextDestRow = .Cells.Find(What:="*", after:=.Range("A1"), _<o></o>
SearchOrder:=xlByRows, SearchDirection:=xlPrevious).Row + 1<o></o>
For Each c In rngRowItems<o></o>
.Cells(lngNextDestRow, c.Column) = c.Value<o></o>
'c.ClearContents 'option to "move" instead of copy<o></o>
Next c<o></o>
End With<o></o>
End With<o></o>
<o></o>
Set rngRowItems = Nothing<o></o>
Set c = Nothing<o></o>
End Sub
im not sure it it's possible to get it to do something like this.
if R6 , Arrest = true, then Copy A6,B6,C6,D6,R6,S6 to sheet "Arrests".
but i need it to do that for every Colume in R if it = Arrests
basiclly in Colum R i have 5 different avalible entries, each one needs to be moved to a different sheet, arrests, discharge, admit, called off, Transport.
QUESTION
how do i get my macro to copy A,B,C,D,E,F,G(6) if R6 = _____ (arrest in this case)
dont know if it helps by my work is old school and working with 2003 excel.