Cell Formats

User avatar
BobH
UraniumLounger
Posts: 9265
Joined: 13 Feb 2010, 01:27
Location: Deep in the Heart of Texas

Cell Formats

Post by BobH »

I use a spreadsheet to track (and verify) my electricity usage and billing. I have a smart meter and can access the database that is updated on weekdays; so I can see usage as it accretes and project what charges will be for the billing period.

I've noticed that when I copy data from the database and paste it into my spreadsheet, that the cell formatting from the database results rather than the formatting I'd prefer. I want to see KWH to 3 decimal points.

Is there a way to preserve my column formatting while copying data into those columns?

:cheers: :chocciebar: :thankyou:
Bob's yer Uncle
(1/2)(1+√5)
Dell Intel Core i5 Laptop, 3570K,1.60 GHz, 8 GB RAM, Windows 11 64-bit, LibreOffice,and other bits and bobs

User avatar
HansV
Administrator
Posts: 78401
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: Cell Formats

Post by HansV »

Copy the data in the database.
Select the (first) target cell.
Click the lower half of the Paste button on the Home tab of the ribbon.
Select 'Match Destination Formatting' or press M.
S0869.png
You do not have the required permissions to view the files attached to this post.
Best wishes,
Hans

User avatar
StuartR
Administrator
Posts: 12601
Joined: 16 Jan 2010, 15:49
Location: London, Europe

Re: Cell Formats

Post by StuartR »

Alternatively you can right click the target cell and use Paste Values to paste just the value of the copied data, and not the formatting.
You do not have the required permissions to view the files attached to this post.
StuartR


User avatar
BobH
UraniumLounger
Posts: 9265
Joined: 13 Feb 2010, 01:27
Location: Deep in the Heart of Texas

Re: Cell Formats

Post by BobH »

I knew there had to be an answer.

Thank you, Gentlemen!!!

:cheers: :chocciebar: :thankyou:
Bob's yer Uncle
(1/2)(1+√5)
Dell Intel Core i5 Laptop, 3570K,1.60 GHz, 8 GB RAM, Windows 11 64-bit, LibreOffice,and other bits and bobs

User avatar
HansV
Administrator
Posts: 78401
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: Cell Formats

Post by HansV »

@StuartR: the options in your screenshot are available when you copy/paste within Excel. If the clipboard contains external data (from a database for example), the options are as shown in my screenshot.
Best wishes,
Hans

User avatar
StuartR
Administrator
Posts: 12601
Joined: 16 Jan 2010, 15:49
Location: London, Europe

Re: Cell Formats

Post by StuartR »

Thanks for the correction Hans
StuartR


User avatar
SpeakEasy
4StarLounger
Posts: 544
Joined: 27 Jun 2021, 10:46

Re: Cell Formats

Post by SpeakEasy »

>the options are as shown in my screenshot

To be fair, that really rather depends on what formats the source application makes available on the clipboard

User avatar
HansV
Administrator
Posts: 78401
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: Cell Formats

Post by HansV »

Thanks!
Best wishes,
Hans