#1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 273
Default copy and paste.

I have a spreadsheet (shift patterns) which have cells populated with a value.
What I want to do is, if the cell value = "" then copy a 7 cells which are
populated with different colours.
there are 10 different patterns. I want the finished spread sheet to display
a colour in each cell which equals a specific work pattern, i.e a red cell
equals a 8 until 5 shift pattern.
Any help would be very much appriciated. Gary
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 5,441
Default copy and paste.

Gary,

You could use the worksheet's change event to do that. For example, make up the ten sets of seven
colored cells with the formatting that you want, and name them FormatSet1, FormatSet2,.....
FormatSet10.

If your cells "populated with a value" are in column A, code like this will copy the sets of
formatting and paste the formatting when you type in the 1, 2, .... 10 (you could use any value in
the name that you like....)

Copy the code, right-click the sheet tab, select "View Code" and paste the code into the window that
appears.

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Cells.Count 1 Then Exit Sub
If Target.Column < 1 Then Exit Sub
On Error Resume Next
Range("FormatSet" & Target.Value).Copy
Target(1, 2).PasteSpecial xlPasteFormats
Target(2, 1).Select
End Sub


--
HTH,
Bernie
MS Excel MVP


"Gary" wrote in message
...
I have a spreadsheet (shift patterns) which have cells populated with a value.
What I want to do is, if the cell value = "" then copy a 7 cells which are
populated with different colours.
there are 10 different patterns. I want the finished spread sheet to display
a colour in each cell which equals a specific work pattern, i.e a red cell
equals a 8 until 5 shift pattern.
Any help would be very much appriciated. Gary



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
Can't Copy and Paste or Paste Special between Excel Workbooks wllee Excel Discussion (Misc queries) 5 April 29th 23 03:43 AM
Copy and paste versus copy and insert copied cells Alana New Users to Excel 1 September 28th 07 08:58 PM
Copy/Paste how to avoid the copy of formula cells w/o calc values Dennis Excel Discussion (Misc queries) 10 March 2nd 06 10:47 PM
Excel cut/Paste Problem: Year changes after data is copy and paste Asif Excel Discussion (Misc queries) 2 December 9th 05 05:16 PM
I cannot paste from one workbook to another. Copy works, paste do. JimmyMc Excel Discussion (Misc queries) 1 June 10th 05 03:54 PM


All times are GMT +1. The time now is 09:00 PM.

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

About Us

"It's about Microsoft Excel"