Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default formatting function?!

I have a spreadsheet full of validations and different
formatting. I want to protect it all but at the same
time, let the user change the values in all the cells.
Everything seems to work except with it comes down to
copy and pasting. If I copy from a certain cell with a
certain format and then paste it in a different cell with
a DIFFERENT format, it somehow overides the format.

Cell 1 has numbers
Cell 2 accepts only letters

Copy cell 1 into cell 2 and it works yet if you type it
manually without copy pasting there is a pop up with an
error.

Any ideas on how I can protect the formatting using vba
so even the "copy & paste" won't get rid of it?!

Thanks,

Marc

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 28
Default formatting function?!

Hi Macr,

I have the following suggestions for you:

Solution one: Reformat it every time when user does something with the cells
Have one macro to record the last selected cell(s) and have the second macro (Worksheet_SelectionChange) to refresh it. The second macro reformats it based on the location of the last selected cell.

Solution two: Prevent user from paste anything onto the worksheet
In Worksheet_Activate, Workbook_WindowActivate, and Worksheet_SelectionChange macros add this line: "Application.cutcopymode=false"


"Marc" wrote:

I have a spreadsheet full of validations and different
formatting. I want to protect it all but at the same
time, let the user change the values in all the cells.
Everything seems to work except with it comes down to
copy and pasting. If I copy from a certain cell with a
certain format and then paste it in a different cell with
a DIFFERENT format, it somehow overides the format.

Cell 1 has numbers
Cell 2 accepts only letters

Copy cell 1 into cell 2 and it works yet if you type it
manually without copy pasting there is a pop up with an
error.

Any ideas on how I can protect the formatting using vba
so even the "copy & paste" won't get rid of it?!

Thanks,

Marc


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Function Formatting OC Excel Worksheet Functions 1 January 8th 09 08:29 PM
Function for formatting? mz Excel Worksheet Functions 1 December 20th 07 10:01 AM
function formatting a cell papero Excel Discussion (Misc queries) 3 November 19th 07 05:32 PM
Formatting the =NOW() function ? dim Excel Worksheet Functions 4 October 6th 07 08:19 PM
Formatting from a Function VALid Excel Discussion (Misc queries) 3 January 2nd 06 03:27 PM


All times are GMT +1. The time now is 12:13 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"