How to move the specific articles so that their cells still blanc ?

happydz

New Member
Joined
Jan 11, 2017
Messages
47
Office Version
  1. 2010
Hello, I have a spreadsheet with many rows and I need to move specific articles (red articles) from the column A to the column C so that their cells still blanc in column A, can someone help with that?

blanc_articles.xlsx
ABC
1article 1
2article 2
3article 3
4article 4
5article 5
6article 6
7article 7
8article 8
9article 9
10article 10
11article 11
12article 12
13article 13
14article 14
15article 15
16article 16
17article 17
18article 18
19article 19
20article 20
21article 21
22article 22
23article 23
24article 24
25article 25
26article 26
27article 27
28article 28
29article 29
30article 30
31article 31
32article 32
33article 33
34article 34
35article 35
36article 36
37article 37
38article 38
39article 39
40article 40
41article 41
42article 42
43article 43
44article 44
45article 45
46article 46
47article 47
48article 48
49article 49
50article 50
51article 51
52article 52
53article 53
54article 54
55article 55
56article 56
57article 57
58article 58
59article 59
60article 60
61article 61
62article 62
63article 63
64article 64
65article 65
66article 66
67article 67
68article 68
69article 69
70article 70
71article 71
72article 72
73article 73
74article 74
75article 75
76article 76
77article 77
78article 78
79article 79
80article 80
81article 81
82article 82
83article 83
84article 84
85article 85
86article 86
87article 87
88article 88
89article 89
90article 90
91article 91
92article 92
93article 93
94article 94
95article 95
96article 96
97article 97
98article 98
99article 99
100article 100
Feuil7
 

Excel Facts

Difference between two dates
Secret function! Use =DATEDIF(A2,B2,"Y")&" years"&=DATEDIF(A2,B2,"YM")&" months"&=DATEDIF(A2,B2,"MD")&" days"
So can we assume that all cells that have a foreground that is not black need to move?
 
Upvote 0
VBA Code:
Sub MoveByColor()
Dim c As Range
Application.ScreenUpdating = False
For Each c In Range("A1:A" & Cells(Rows.Count, "A").End(xlUp).Row)
    If c.Font.Color <> vbBlack Then
        With c
            .Offset(0, 2).Value = .Value
            .Offset(0, 2).Font.Color = .Font.Color
            .Value = ""
        End With
    End If
Next c
Application.ScreenUpdating = True
End Sub
 
Upvote 0
VBA Code:
Sub MoveByColor()
Dim c As Range
Application.ScreenUpdating = False
For Each c In Range("A1:A" & Cells(Rows.Count, "A").End(xlUp).Row)
    If c.Font.Color <> vbBlack Then
        With c
            .Offset(0, 2).Value = .Value
            .Offset(0, 2).Font.Color = .Font.Color
            .Value = ""
        End With
    End If
Next c
Application.ScreenUpdating = True
End Sub
Thank you so much. Is there other trick without using VBA code because I am not advanced in Excel and I am not very familiar with VBA coding (I cannot remember the code) so I need, please, a simple trick like filtering or something basic like that is simple to use. Thank you again
 
Upvote 0
Depends what you are doing. You can try this trick.
Apply filter over column "A". Press Filter dropdown button and in the filter menu go to the "Filter By Color".
On the right menu select font color that you want to remove (red in this case). After filtering select all cells in the column "A".
After that put mouse on the right bottom and when a black cross apears, with mouse down drag selection to the column "C".
Now select red fonts in the column "A" and "B", or just "B". Delete selection and close filter.
 
Upvote 0
Solution
I suggest that you update your Account details (or click your user name at the top right of the forum) so helpers always know what Excel version(s) & platform(s) you are using as the best solution often varies by version. (Don’t forget to scroll down & ‘Save’)

I am not very familiar with VBA coding (I cannot remember the code)
You don't need to remember the code.
1. With your workbook active press Alt+F11 to bring up the vba window.
2. In the Visual Basic window use the menu to Insert|Module
3. Copy and Paste the code into the main right hand pane that opens at step 2.
4. Close the Visual Basic window.
5. Press Alt+F8 to bring up the Macro dialog
6. Select the macro & click ‘Run’
7. Your workbook will need to be saved as a macro-enabled workbook (*.xlsm). The code will be saved with the workbook.

If you want to try the macro approach then here is a slight variation to try

VBA Code:
Sub MoveByColor_v2()
  Dim c As Range
 
  Application.ScreenUpdating = False
  For Each c In Range("A1:A" & Cells(Rows.Count, "A").End(xlUp).Row)
      If c.Font.Color <> vbBlack Then c.Insert Shift:=xlToRight
  Next c
  Application.ScreenUpdating = True
End Sub
 
Upvote 0
Depends what you are doing. You can try this trick.
Apply filter over column "A". Press Filter dropdown button and in the filter menu go to the "Filter By Color".
On the right menu select font color that you want to remove (red in this case). After filtering select all cells in the column "A".
After that put mouse on the right bottom and when a black cross apears, with mouse down drag selection to the column "C".
Now select red fonts in the column "A" and "B", or just "B". Delete selection and close filter.
thank you so much
 
Upvote 0

Forum statistics

Threads
1,224,819
Messages
6,181,153
Members
453,021
Latest member
Justyna P

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