Copy specific cells to separate worksheets upon 2 conditions
Solved/Closed
Fwong
Posts
11
Registration date
Friday 15 May 2015
Status
Member
Last seen
5 June 2015
-
30 May 2015 à 18:13
vcoolio Posts 1411 Registration date Thursday 24 July 2014 Status Moderator Last seen 6 September 2024 - 1 Jun 2015 à 08:28
vcoolio Posts 1411 Registration date Thursday 24 July 2014 Status Moderator Last seen 6 September 2024 - 1 Jun 2015 à 08:28
Related:
- Copy specific cells to separate worksheets upon 2 conditions
- 텐타클 락커 2 - Download - Adult games
- How to find specific words on a page - Guide
- How do i find a specific video on youtube - Guide
- My cute roommate 2 - Download - Adult games
- Fnia 2 apk - Download - Adult games
2 responses
vcoolio
Posts
1411
Registration date
Thursday 24 July 2014
Status
Moderator
Last seen
6 September 2024
262
1 Jun 2015 à 04:49
1 Jun 2015 à 04:49
Hello again Felicia,
You could have continued this in your last thread. However, in a standard module, place the following code:-
and in the sheet 1 module, place the following:-
You should now be able to make "Yes" entries in sheet 1, Column AA to have the same cells as previous transferred to sheet 2 and "Yes" entries in sheet 1, Column BB to have the same cells transferred to sheet 3.
Following is the sample work book for your perusal:-
https://www.dropbox.com/s/9q8gi658t17n1hk/Fwong%286%29.xlsm?dl=0
I hope that this helps.
Cheerio,
vcoolio.
You could have continued this in your last thread. However, in a standard module, place the following code:-
Sub CopyIt()
Application.ScreenUpdating = False
Dim lRow As Long
lRow = Range("A" & Rows.Count).End(xlUp).Row
Sheets("sheet1").Select
For Each cell In Range("AA2:AA" & lRow)
If cell.Value = "Yes" Then
If Cells(cell.Row, "A") = "" Then
Cells(cell.Row, "A") = " "
End If
If Cells(cell.Row, "G") = "" Then
Cells(cell.Row, "G") = " "
End If
If Cells(cell.Row, "J") = "" Then
Cells(cell.Row, "J") = " "
End If
End If
Next cell
Sheets("sheet1").Select
For Each cell In Range("BB2:BB" & lRow)
If cell.Value = "Yes" Then
If Cells(cell.Row, "A") = "" Then
Cells(cell.Row, "A") = " "
End If
If Cells(cell.Row, "G") = "" Then
Cells(cell.Row, "G") = " "
End If
If Cells(cell.Row, "J") = "" Then
Cells(cell.Row, "J") = " "
End If
End If
Next cell
For I = 2 To lRow
If Cells(i, 27).Value = "Yes" Then
Range(Cells(i, 1), Cells(i, 1)).Copy Sheets("Sheet2").Range("B" & Rows.Count).End(xlUp).Offset(1, 0)
Range(Cells(i, 7), Cells(i, 7)).Copy Sheets("Sheet2").Range("D" & Rows.Count).End(xlUp).Offset(1, 0)
Range(Cells(i, 10), Cells(i, 10)).Copy Sheets("Sheet2").Range("C" & Rows.Count).End(xlUp).Offset(1, 0)
End If
If Cells(i, 54).Value = "Yes" Then
Range(Cells(i, 1), Cells(i, 1)).Copy Sheets("Sheet3").Range("B" & Rows.Count).End(xlUp).Offset(1, 0)
Range(Cells(i, 7), Cells(i, 7)).Copy Sheets("Sheet3").Range("D" & Rows.Count).End(xlUp).Offset(1, 0)
Range(Cells(i, 10), Cells(i, 10)).Copy Sheets("Sheet3").Range("C" & Rows.Count).End(xlUp).Offset(1, 0)
End If
Next
Sheets("Sheet2").Range("B1:D" & Rows.Count).RemoveDuplicates Columns:=Array(1, 2, 3), Header:=xlYes
Sheets("Sheet3").Range("B1:D" & Rows.Count).RemoveDuplicates Columns:=Array(1, 2, 3), Header:=xlYes
Application.ScreenUpdating = True
Application.CutCopyMode = False
End Sub
and in the sheet 1 module, place the following:-
Private Sub Worksheet_Change(ByVal Target As Range) If Target.Cells.Count > 1 Then Exit Sub CopyIt End Sub
You should now be able to make "Yes" entries in sheet 1, Column AA to have the same cells as previous transferred to sheet 2 and "Yes" entries in sheet 1, Column BB to have the same cells transferred to sheet 3.
Following is the sample work book for your perusal:-
https://www.dropbox.com/s/9q8gi658t17n1hk/Fwong%286%29.xlsm?dl=0
I hope that this helps.
Cheerio,
vcoolio.
vcoolio
Posts
1411
Registration date
Thursday 24 July 2014
Status
Moderator
Last seen
6 September 2024
262
1 Jun 2015 à 08:28
1 Jun 2015 à 08:28
Hello Felicia,
You're welcome. Glad that I could help.
Cheerio,
vcoolio.
You're welcome. Glad that I could help.
Cheerio,
vcoolio.
1 Jun 2015 à 07:38
Thanks a million,
Felicia