Static Copy of Cell Result

MrDB4Excel

Active Member
Joined
Jan 29, 2004
Messages
348
Office Version
  1. 2013
Platform
  1. Windows
When a cell gets a result because of conditional formatting how to copy that cell’s result to another location as a static copy.

The attached Xl2bb Mini Sheets are as follows:

ProjectedSavings: This sheet is a bogus copy of another sheet I use to gather data from other workbooks, but here only shows some bogus numbers to facilitate an intended outcome.

ProjectedMonthTotals: This sheet seeks to record the “Projected Total Available for New Home Purchase by the End of 2022” for each month. My intent is for each record to become static when copied to the relevant month’s cell in column B “Approximate Total $ Saved by End of Year”. In either sheet, as indicated by the attached image showing conditional formatting, the specific cell in each sheet that shows a result of the formula within such cell when the two dates are equal is what I want to be copied to the relevant month in column B in sheet ProjectedMonthTotals.

Obviously, I could do this manually but was hoping there is a method to automate this process so that at the end of any given month when the conditional formatting displays the intended result then that result gets copied statically to the relevant month in column B of sheet ProjectedMonthTotals.

BogusCellResultCopy.xlsm
EFGHIJK
14/28/202210:42:01
2
3Current Account Balance
4$1,000.00Months Left of 2022 After Current Pension Month8
5Current Savings Status$10,000.00
61/1/20224Projected Monthly Savings From Pension After Expenses$1,000.00
75/1/2022117Projected Savings From Pension Through To Year's End$8,000.00
84/30/2022Current Bank Balance$1,000.00
9=IF($A20=2,$D$1,"")Total Projected Savings$19,000.00
104/28/2022 10:42Projected Sale of Current Home$100,000.00
11Current Time ððð10:42:01Projected Total Available for New Home Purchase by the End of 2022$119,000.00ProjectedMonthTotals
12Today4/28/20222022ï Year
13B4Today4/27/2022Last Day of Month Get Projected Total & Paste in Appropriate Month in ProjectedMonthTotals Sheet4ï Month
14After Today4/29/2022
15Current MonthApril20222022: Current Year's Day Number Is 118
16 118
17365247 Days Remaining in 2022
18
19247
ProjectedSavings
Cell Formulas
RangeFormula
F1,F12F1=TODAY()
G1,F10G1=NOW()
I4I4="Months Left of "&J12&" After Current Pension Month"
J4J4=12-MONTH(F12)
F6F6=DATEDIF(E6,E7,"m")
F7F7=ABS(IF(ISBLANK(E6),"",TODAY()-E6))
E7E7=EOMONTH(F1,0)+1
E8E8=EOMONTH(F1,0)
J7J7=SUM(J6*J4)
J8J8=F4
J9J9=SUM(J5,J7:J8)
G11G11=TIME(HOUR(F10),MINUTE(F10), SECOND(F10))
I11I11="Projected Total Available for New Home Purchase by the End of "&J12
J11J11=SUM(J9:J10)
F13F13=SUM(F12-1)
F14F14=SUM(F12+1)
F15F15=TEXT(TODAY(),"MMMM")
J15J15=YEAR(TODAY())
K15K15=J15&": Current Year's Day Number Is "&J16
I16I16=IF(F12=E8, J11, "")
J16J16=TODAY()-DATE(YEAR(TODAY()),1,0)
J17J17=DATE(YEAR(F1),12,31)-DATE(YEAR(F1),1,1)+1
K17K17=J19&" Days Remaining in "&J15
J19J19=SUM(J17-J16)
Cells with Conditional Formatting
CellConditionCell FormatStop If True
I16Expression=I16=J11textNO
A1:E1Expression=MOD(ROW(),2)=0textNO


Cell Formulas
RangeFormula
C12:C22,C3:C10C3=SUM(C2-1)
H14H14=IF($I$15=$I$16,$I$14,"")
I14I14=ProjectedSavings!J11
I15I15=TODAY()
I16I16=EOMONTH(I15,0)
A2:A10A2="Per "&F5&" / "&$E$2&" With "&C2&" Months Remaining"
A11:A22A11="Per "&F2&" / "&$E$3&" With "&C11&" Months Remaining"
Cells with Conditional Formatting
CellConditionCell FormatStop If True
H14Expression=H14=I14textNO
 

Attachments

  • Projected Savings138.png
    Projected Savings138.png
    137.5 KB · Views: 23

Excel Facts

Best way to learn Power Query?
Read M is for (Data) Monkey book by Ken Puls and Miguel Escobar. It is the complete guide to Power Query.
So if I understand correctly, when you would open the sheet on the last day of the month, then a macro would take the value from sheet ProjectSavings!J11 and put it into ProjectedMonthSavings!Bx

You can program that in the workbook code-module, using the Workbook_Open() event.

Need help with that?
 
Upvote 0
So if I understand correctly, when you would open the sheet on the last day of the month, then a macro would take the value from sheet ProjectSavings!J11 and put it into ProjectedMonthSavings!Bx

You can program that in the workbook code-module, using the Workbook_Open() event.

Need help with that?
Well sijpie, I have since come up with the following code which seems to work well. Being that this workbook is the second file I open and leave open all day which contains links to many other workbooks I work on during the day then having a Workbook_Open() event seems different, but share it anyway if you like. I will surely learn something new.
Many thanks

Sub ApproxTotalUpdate()
'
' ApproxTotalUpdate Macro
' Updates End of Month Approximate Total Savings
ActiveSheet.Range("J33").Select
Selection.Copy
Sheets("ProjectedMonthTotals").Select
Selection.PasteSpecial Paste:=xlPasteValuesAndNumberFormats, Operation:= _
xlNone, SkipBlanks:=False, Transpose:=False
ActiveCell.Offset(1, 0).Select
End Sub

However, I use this in conjunction with this formula: =IF(F34=E30, J33, "") and conditional formatting to highlight the cell this formula resides in when =I38=J33 and applied to I38.
These cell references are different than the bogus Xl2bb Mini Sheets I posted because I am doing this in the worksheet that the bogus sheet was tailored upon.
1651580908773.png
 
Upvote 0

Forum statistics

Threads
1,224,820
Messages
6,181,157
Members
453,021
Latest member
Justyna P

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