Can vba return excel cell value with formats

thatboyp

New Member
Joined
Jan 25, 2005
Messages
6
Hi,

I have two tabs in a workbook. the first tab is to entry data and the second tab act like a database. The first tab - I got one button that will save and a second one that will pull the data from the database and populate the values into the same cell. The button that does the populating the cell is a pull down box. When an item is selected from the pull down it will populate all the data into the right cell that I reference. I can make changes into these cell, once I am done update information into these cell, I hit the save button and it save the the data into the database.

When I do the updating with new data I highlight the text to blue font. The old text are kept in black font.

Here is the problem I need help on: When I do the pull down from the first button to retrieve the data - all the text are converted to BLACK font. When this happen the people that look at my first tab don't know what have been updated because all the text are black font now. The blue font are not save to the database on tab number two. Is there a vb code to get the value pull from the database and the format too?

I can attach my file for someone to review it...

Thanks,

Peter
 
I think I see what you are saying.

The first step is to retrieve information from your database sheet, you modify that information, manually color your changes blue and then you want to publish your changes to the database sheet with the same font color formats.
When you pull back the information again, you want the format to carry over from the database sheet.

Unfortunately, I believe this would be a major rewrite of your code. Your current code only captures the values, not the formatting, into variables. I don't believe it is possible to store values and formatting in a variable. I think you will need to copy/paste special all instead.

Yup, this is what I wanted. Do you have an example of codes to do that? How to do the copy and paste to a database?

Thanks,

Peter
 
Upvote 0

Excel Facts

Test for Multiple Conditions in IF?
Use AND(test, test, test, test) or OR(test, test, test, ...) as the logical_test argument of IF.

Forum statistics

Threads
1,224,591
Messages
6,179,768
Members
452,940
Latest member
rootytrip

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