Copy and Pasting Bold Text

mdm05

New Member
Joined
Aug 7, 2017
Messages
3
I am working with a spreadsheet and I need a little support. In Column D I would like to find any text that is bold, copy that text, and then paste it into Column C. If possible, I would then like to delete the bold text from Column D. Any ideas on how to make this work?
 

Excel Facts

Last used cell?
Press Ctrl+End to move to what Excel thinks is the last used cell.
I am working with a spreadsheet and I need a little support. In Column D I would like to find any text that is bold, copy that text, and then paste it into Column C. If possible, I would then like to delete the bold text from Column D. Any ideas on how to make this work?
Where in Column C should the values be pasted... on the same row as the bold text or one after the other starting at cell C1? If on the same row, are there existing values in Column C? If so, I presume we are overwriting any values next to the bold text while not touching any other values in Column C, correct?
 
Upvote 0
That is correct. Column C is currently blank, but it should stay consistent with the row.
 
Upvote 0
That is correct. Column C is currently blank, but it should stay consistent with the row.
Give this macro a try...
Code:
Sub MoveBoldOverToColumnC()
  Dim LastRow As Long
  LastRow = Cells(Rows.Count, "D").End(xlUp).Row
  Application.ScreenUpdating = False
  Range("C1:C" & LastRow).Value = Range("D1:D" & LastRow).Value
  Application.FindFormat.Clear
  Application.FindFormat.Font.Bold = True
  Columns("D").Replace "", "", SearchFormat:=True, ReplaceFormat:=False
  Application.FindFormat.Clear
  Columns("D").SpecialCells(xlConstants).Offset(, -1).ClearContents
  Application.ScreenUpdating = True
End Sub
 
Upvote 0
Thank you so much for all of your help! I have to be honest, I am new to working with macros. Where do I paste this in?
 
Upvote 0
Thank you so much for all of your help! I have to be honest, I am new to working with macros. Where do I paste this in?
HOW TO INSTALL MACROs
------------------------------------
If you are new to macros, they are easy to install and use. To install it, simply press ALT+F11 to go into the VB editor and, once there, click Insert/Module on its menu bar, then copy/paste the above code into the code window that just opened up. That's it.... you are done. To use the macro, go back to the worksheet with your data on it and press ALT+F8, select the macro name (MoveBoldOverToColumnC) from the list that appears and click the Run button. The macro will execute and perform the action(s) you asked for. If you will need to do this again in this same workbook, and if you are using XL2007 or above, make sure you save your file as an "Excel Macro-Enabled Workbook (*.xlsm) and answer the "do you want to enable macros" question as "Yes" or "OK" (depending on the button label for your version of Excel) the next time you open your workbook.
 
Upvote 0

Forum statistics

Threads
1,223,903
Messages
6,175,289
Members
452,631
Latest member
a_potato

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