Copying from one Workbook to Another #REF

kpierce

Board Regular
Joined
Jun 21, 2010
Messages
76
Hello -
I have gotten a nice script going thanks to all the help on this forum. My scropt opens all the workbooks in a specific directory and copies over information into a consolidated sheet in the MASTER workbook. Like a dashboard.

This all worked with when I just had cell colors and values, but now I have added several nested IF statements and conditional formatting.

So when I run the script now, it tries to copy over all the IF statements and it replaces the cells, etc. with #REF.

What I want to do is just 'snag' the color and value from the cell..
For example a cell I want to copy contains:
=IF(O35<=-0.002,"R",IF(O35<=-0.001,"Y","G")), and the Cell is GREEN in the sundry file that is being read.

Now when I read that cell and place it into my MASTER I get: #REF
=IF(#REF!<=-0.002,"R",IF(#REF!<=-0.001,"Y","G"))

the code that is copying over this section is:
ws.Range("C2").Copy _
wsDest.Range("A" & Rows.Count).End(xlUp).Offset(1)

These cells can be: R(Red), Y(Yellow), G(Green), C(Complete), Blank. I can deal with the conditional formatting, but how do I just pick the value from the cell and not the formula?

Hopefully there is a way to get this to work. Otherwise, I am really 'hosed'.

thanks
 

Excel Facts

What is the shortcut key for Format Selection?
Ctrl+1 (the number one) will open the Format dialog for whatever is selected.
Don't copy .... just get the value, like:
Code:
wsDest.Range("A" & Rows.Count).End(xlUp).Offset(1).Value = ws.Range("C2").Value
 
Upvote 0

Forum statistics

Threads
1,224,542
Messages
6,179,421
Members
452,913
Latest member
JWD210

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