Copying column with conditional formating VBA

Olavfinnerud

New Member
Joined
Jun 7, 2022
Messages
16
Office Version
  1. 2021
Platform
  1. Windows
Hi, I have made a sheet to check results from a water test against a limit. I started with one column where you insert the results from the test. And if the result is higher than the value written under Grenseverdier Bærum Kommune then the cell becomes red, if its under the cell becomes green, and if it is equal the cell becomes green. I then added a button to insert a new column when you need to enter the results from a new test. The problem i have is when i insert a new column the conditional formating in the cells chances. Originally i have three conditions for each cell. One over, one under and one equal. When i add a new column multiple conditions gets added. I need help to get the same formatting for each column that i add. I have attached a picture of the spreadsheet and also the code i use to insert a new column.

I would really appreciate it if somebody could help me out! Thank you.
 

Attachments

  • Grenseverdier vann prøve.png
    Grenseverdier vann prøve.png
    37.2 KB · Views: 8
  • vannprøve macro.png
    vannprøve macro.png
    33.1 KB · Views: 8

Excel Facts

What is the last column in Excel?
Excel columns run from A to Z, AA to AZ, AAA to XFD. The last column is XFD.
Probably there was something wrong in the CF of your original column. Normally when you insert a new column you should always find 3 CF in the original column and 3 CF in the new column, the only difference you should see is that they refer to a different range. This difference will update in every column every time you insert a new column but you will always have only 3 CF.
 
Upvote 0

Forum statistics

Threads
1,223,099
Messages
6,170,111
Members
452,302
Latest member
TaMere

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
Back
Top