if Specific cell contains specific text then copy paste value from cell x to cell y

Summer7sun

New Member
Joined
Sep 14, 2017
Messages
33
I am very new to coding need help with the code," Sorry for my mistakes its my first post"
I am trying to copy data from Cell E8 to Cell AB8 if Cell T8 has Yes and if T8 has no the want to copy E8 to AC8 and want it to do the same thing for T9,T10,T11 till T108.

I have this Successfully working on only T8 Row want the same for other cells till T108. I really dont know how to go about this further Please Help. Thank You
smile.gif




If Range("T8") = "Yes" Then
Sheets("Engine").Select
Sheets("Engine").Name = "Engine"
Range("E8").Select
Selection.Copy
Range("AB8").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Range("AB3").Select
Application.CutCopyMode = False
End If

If Range("T8") = "No" Then
Sheets("Engine").Select
Sheets("Engine").Name = "Engine"
Range("E8").Select
Selection.Copy
Range("AC8").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Range("AB3").Select
Application.CutCopyMode = False
End If
 
Not sure why, changed code and this does put the correct values into same rows for columns AB and AC respectively where column T is Yes or No only:
Code:
Sub Update_Col()
    
    Application.ScreenUpdating = False
    
    If ActiveSheet.AutoFilterMode Then ActiveSheet.AutoFilterMode = False
    
    With Range("E7:AC108")
        .AutoFilter
        .AutoFilter Field:=16, Criteria1:="Yes"
    End With
    Range("AB8:AB108").SpecialCells(xlCellTypeVisible).Value = Range("E9:E109").SpecialCells(xlCellTypeVisible).Value
    
    ActiveSheet.ShowAllData
    
    With Range("E7:AC108")
        .AutoFilter
        .AutoFilter Field:=16, Criteria1:="No"
    End With
    Range("AC8:AC108").SpecialCells(xlCellTypeVisible).Value = Range("E9:E109").SpecialCells(xlCellTypeVisible).Value
    
    ActiveSheet.AutoFilterMode = False
    
    Application.ScreenUpdating = True
        
End Sub
 
Upvote 0

Excel Facts

Copy a format multiple times
Select a formatted range. Double-click the Format Painter (left side of Home tab). You can paste formatting multiple times. Esc to stop
JackDanIce you helped me solve the puzzle .. Awesome Thanks a lot .. :) what do i have to do to increase your rating ... m new to these codes and forum ... Plz add me as friend
 
Upvote 0
Hi the code really works fine till u manually type the data on T column ... I just Noted that the Data Yes or No is extracted from another worksheet when a condition is met on that sheet and the data on the other is coming from the data server which cant be edited .... so just in simple term if I manually type Yes or No on any T coumn cell the code works ... and as soon as I Paste Link I start getting error :( ....
 
Upvote 0

Forum statistics

Threads
1,216,152
Messages
6,129,168
Members
449,490
Latest member
TheSliink

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top