Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
mm mm is offline
external usenet poster
 
Posts: 37
Default Retaining conditonal formats

Hi, I need some help please!

I've designed a sheet to collect data from users which has been set up with
lots of set formats (e.g round £ to two decimal places). That's fine and I'm
happy with what it's doing.

The problem that I'm having is that some users are just copying and pasting
chunks of data from other data bases into the sheet and I'm loosing all the
set formats that have set up.

My question is: How do I allow users to both, type the data in, or paste
data in and the sheet to retain the formats that I've set up! Any help or
suggesions would be appreciated.

Many thanks,

MM
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2,510
Default Retaining conditonal formats

Hi MM,

This can be done with code in the Workbook Open event. When you have set up
the worksheet with the formats that you want, you copy the Worksheet so that
you have a duplicate. Then in the Workbook open event you copy the duplicate
sheet and Paste Special - Formats into the main worksheet.

The duplicate worksheet can be hidden. If hidden with code it can be
VeryHidden so that the users cannot unhide it without code.

If you want such a method, then let me know and I can provide the code. Let
me know if you require instructions to copy the code into your workbook. Also
what version of Excel you are using so I can include instructions for
enabling macros.

Note that the method does not prevent the users changing formats; it just
returns the correct formats when the workbook is opened.

If you don't want the macro code in the workbook that all of the users have,
then it can be placed in a separate workbook together with the copy of the
worksheet and then you can open the workbook via the one with the code. Let
me know what you want. If you want this method then let me knw the full name
of the main workbook.

--
Regards,

OssieMac


"MM" wrote:

Hi, I need some help please!

I've designed a sheet to collect data from users which has been set up with
lots of set formats (e.g round £ to two decimal places). That's fine and I'm
happy with what it's doing.

The problem that I'm having is that some users are just copying and pasting
chunks of data from other data bases into the sheet and I'm loosing all the
set formats that have set up.

My question is: How do I allow users to both, type the data in, or paste
data in and the sheet to retain the formats that I've set up! Any help or
suggesions would be appreciated.

Many thanks,

MM

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 22,906
Default Retaining conditonal formats

Add this event code to the worksheet module.

Right-click and "View Code" to access the module.

Private Sub Worksheet_Change(ByVal Target As Range)
'retain formatting when a cell is copied over
Dim myValue
With Application
.EnableEvents = False
myValue = Target.Value
.Undo
Target = myValue
.EnableEvents = True
End With
Application.CutCopyMode = False
End Sub


Gord Dibben MS Excel MVP

On Sun, 7 Feb 2010 16:21:01 -0800, MM wrote:

Hi, I need some help please!

I've designed a sheet to collect data from users which has been set up with
lots of set formats (e.g round £ to two decimal places). That's fine and I'm
happy with what it's doing.

The problem that I'm having is that some users are just copying and pasting
chunks of data from other data bases into the sheet and I'm loosing all the
set formats that have set up.

My question is: How do I allow users to both, type the data in, or paste
data in and the sheet to retain the formats that I've set up! Any help or
suggesions would be appreciated.

Many thanks,

MM


  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2,510
Default Retaining conditonal formats

I like the idea Gord but using Target.Value prevents a formula being entered
on the worksheet. Using Target.Formula seems to work better.

myValue = Target.Formula
.Undo
Target.Formula = myValue

--
Regards,

OssieMac


"Gord Dibben" wrote:

Add this event code to the worksheet module.

Right-click and "View Code" to access the module.

Private Sub Worksheet_Change(ByVal Target As Range)
'retain formatting when a cell is copied over
Dim myValue
With Application
.EnableEvents = False
myValue = Target.Value
.Undo
Target = myValue
.EnableEvents = True
End With
Application.CutCopyMode = False
End Sub


Gord Dibben MS Excel MVP

On Sun, 7 Feb 2010 16:21:01 -0800, MM wrote:

Hi, I need some help please!

I've designed a sheet to collect data from users which has been set up with
lots of set formats (e.g round £ to two decimal places). That's fine and I'm
happy with what it's doing.

The problem that I'm having is that some users are just copying and pasting
chunks of data from other data bases into the sheet and I'm loosing all the
set formats that have set up.

My question is: How do I allow users to both, type the data in, or paste
data in and the sheet to retain the formats that I've set up! Any help or
suggesions would be appreciated.

Many thanks,

MM


.

  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 22,906
Default Retaining conditonal formats

Good point.

Thanks

On Mon, 8 Feb 2010 21:52:01 -0800, OssieMac
wrote:

I like the idea Gord but using Target.Value prevents a formula being entered
on the worksheet. Using Target.Formula seems to work better.

myValue = Target.Formula
.Undo
Target.Formula = myValue


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
retaining formats when referring to cells Michaeld Excel Discussion (Misc queries) 4 August 25th 07 12:28 PM
5 or more Conditonal formats Hawksby Excel Discussion (Misc queries) 3 March 9th 07 03:16 PM
Multiple Conditonal Formats Dave Excel Discussion (Misc queries) 4 November 2nd 06 11:47 PM
Retaining formats grok Excel Discussion (Misc queries) 11 October 31st 06 07:29 PM
Nested Ifs In Conditonal Formats ANDYPAND New Users to Excel 1 August 2nd 05 04:25 PM


All times are GMT +1. The time now is 04:34 PM.

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"