C
CN
I have 7 collumns:
A B C D E H G
b Ptt F
b Ptt F
bb dd Ptt T
a b d Dgg T
I have 3 condition to work with:
* If column D= "Ptt" & E = "F" then copy col "B" the same row to col "H"
* If column D= "Ptt" & E = "T" then copy col "C" the same row to col "G"
* If column D= "Dgg" & E = "T" then copy col "a" the same row to col "G"
Here I have so far:
Sub ButtonCopy()
Range("B2:F20").Select
Do Until ActiveCell = ""
If ActiveCell = "" Then End
ActiveCell.Select
'ActiveCell.EntireRow.Select
If ActiveCell = "F" Then
With Selection.Interior
..ColorIndex = 6
..Pattern = xlSolid
..PatternColorIndex = xlAutomatic
Range("B2:B20").Select
Selection.Font.ColorIndex = 9
Selection.Copy
'Paste results
ActiveSheet.Paste
Range("H2:H20").Select
ActiveSheet.Paste
Selection.Font.ColorIndex = 9
End With
End If
ActiveCell.Offset(1, 0).Activate
End Sub
I Think I have couple issues on this, please help,
my question is how can I copy in the same row instead copy as range?
and can I make two condition instead of one, this is my first time writting
this, any advise will be very helpful to me.
Thanks in advance,
A B C D E H G
b Ptt F
b Ptt F
bb dd Ptt T
a b d Dgg T
I have 3 condition to work with:
* If column D= "Ptt" & E = "F" then copy col "B" the same row to col "H"
* If column D= "Ptt" & E = "T" then copy col "C" the same row to col "G"
* If column D= "Dgg" & E = "T" then copy col "a" the same row to col "G"
Here I have so far:
Sub ButtonCopy()
Range("B2:F20").Select
Do Until ActiveCell = ""
If ActiveCell = "" Then End
ActiveCell.Select
'ActiveCell.EntireRow.Select
If ActiveCell = "F" Then
With Selection.Interior
..ColorIndex = 6
..Pattern = xlSolid
..PatternColorIndex = xlAutomatic
Range("B2:B20").Select
Selection.Font.ColorIndex = 9
Selection.Copy
'Paste results
ActiveSheet.Paste
Range("H2:H20").Select
ActiveSheet.Paste
Selection.Font.ColorIndex = 9
End With
End If
ActiveCell.Offset(1, 0).Activate
End Sub
I Think I have couple issues on this, please help,
my question is how can I copy in the same row instead copy as range?
and can I make two condition instead of one, this is my first time writting
this, any advise will be very helpful to me.
Thanks in advance,