Problem with formula's and colours

Karinann

New Member
Joined
Jun 12, 2008
Messages
3
I have 2 spreadsheets that i can have open at seperate times. On spreadsheet #2 i have a formular to copy everything that is written on spreadsheet #1. i.e whatever i type into A1 on shreadsheet #1 is automatically put into A1 on spreadsheet #2. The problem i have is that i need the colours to change automatically also. i.e if i type in A1 #1 in the colour red, blu or black, then not only does the writing copy but also the colour. Therefore, my question is, is this possible, and if so how do i do it?!! Any help will be much appritiated. Thank you. :)
 

Excel Facts

How to calculate loan payments in Excel?
Use the PMT function: =PMT(5%/12,60,-25000) is for a $25,000 loan, 5% annual interest, 60 month loan.

MickG

MrExcel MVP
Joined
Jan 9, 2008
Messages
14,841
Hi. This is one way.
If you change a cell colour then enter or change the cell value in a cell in the Active sheet, the same cell in the nominated (in this case sheet 5) sheet changes to the Activesheet cell colour.
Code:
Private Sub Worksheet_Change(ByVal Target As Range)
 Sheets("sheet5").Range(Target.Address).Interior.ColorIndex = Target.Interior.ColorIndex
End Sub
Regards Mick
 
Upvote 0

Karinann

New Member
Joined
Jun 12, 2008
Messages
3
Thank you!!

Just another question if you can, where do i enter the code!!

Sorry, I only know the basics to Excel!:)

Thanks again

Karin x
 
Upvote 0

MickG

MrExcel MVP
Joined
Jan 9, 2008
Messages
14,841
Hi, In the active sheet, Right click the tab, select "View code", The VB Editor window will appear. Paste all the code into the VB Blank window. If it says "Option Explicit" at the top of the window, paste it under there. In any case paste it in the window.
Exit the VB Editor
It should now work whenever you change a cell value.
NB:- Change the sheet Number in the code to suit your needs
If you want to see the VB Editor again Click "Alt + F11"
Regards Mick
 
Upvote 0

Forum statistics

Threads
1,190,898
Messages
5,983,454
Members
439,843
Latest member
PlanetFitness

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
Top