![]() |
|
#1
|
|||
|
|||
|
I have a list of long-tail keywords in Column A.
I want to copy any keyword to another column if it contains a specific keyword like "control". How do I do that? Also, how do I move it to another column instead of copying it over? I'd like to learn both. Appreciate the help, JH |
|
#2
|
||||
|
||||
|
VBA Solution
Code:
Option Explicit
Sub delcontrol()
Application.ScreenUpdating = False
Dim c As Range, rng As Range
Dim lr As Long, lr2 As Long
lr = Range("A" & Rows.Count).End(xlUp).Row
Set rng = Range("A2:A" & lr)
For Each c In rng
If InStr(c, "control") > 0 Then
lr2 = Range("C" & Rows.Count).End(xlUp).Row + 1
c.Copy Range("C" & lr2)
End If
Next c
Application.ScreenUpdating = True
Application.CutCopyMode = False
MsgBox "Action Completed"
End Sub
__________________
Alan עַם יִשְׂרָאֵל חַ Using O365 v2511 |
|
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Required MS-WORD table copy paste solution from one column to another column | USAMA | Word | 4 | 12-05-2021 05:31 PM |
| copy non zero values to new column | Guloluseus | Excel | 3 | 01-10-2016 08:48 AM |
| If column B cell is a certain value then copy and paste the value to column A | Snaybot | Excel Programming | 1 | 12-01-2015 07:10 PM |
| Copy column 1 data into Column 3 | ShailShin | Word VBA | 1 | 06-18-2015 10:49 AM |
| Copy column entries on value | Guloluseus | Excel | 3 | 01-05-2015 08:28 PM |