Excel Macro move cell contents including Underline/Bold

RWazoo

New Member
Joined
Oct 14, 2020
Messages
7
Office Version
  1. 2010
Platform
  1. Windows
Using a macro, I'm copying the contents of one cell to another cell. The contents of the cell being copied may have underlining or bold characters. When the micro copies the contents of the cell, the result is that the underlined and bold characters are lost (become Regular).
 

Excel Facts

How to create a cell-sized chart?
Tiny charts, called Sparklines, were added to Excel 2010. Look for Sparklines on the Insert tab.
A script like this works for me:

VBA Code:
Sub Copy_Range()
'Modified 10/14/2020 3:17:10 PM  EST
Application.ScreenUpdating = False
Range("A1").Copy Range("B4")
Application.ScreenUpdating = True
End Sub
 
Upvote 0
Sheets("Input").Cells(5, 1) = Sheets("Results").Cells(R, 1)

If the cell contents of: Sheets("Results").Cells(R,1) is: Bold Underline
the above statement is returning: Bold Underline to: Cells(5,1)
I would like data to be the same format: Bold Underline
 
Upvote 0
Try
VBA Code:
Sheets("Results").Cells(R, 1).Copy Sheets("Input").Cells(5, 1)
 
Upvote 0
Glad we could help & thanks for the feedback.
 
Upvote 0
My script worked exactly like Fluff script. But in your original post you did not provide specific details.
I figured you would know how to modify my script to your needs.
Glad things are working for you.
 
Upvote 0

Forum statistics

Threads
1,214,622
Messages
6,120,572
Members
448,972
Latest member
Shantanu2024

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