VBA - Formatting & Formulas

aeddipa

Active Member
Joined
Jun 1, 2009
Messages
337
So, I figured out my problem with the reset button macro. I forgot to add a = sign within the quotations.

Now, I was hoping someone could help with the formatting and formulas. When I click the reset button, the correct rows are inserted and the correct funds, but they appear as a formula referencing my "Template" tab. I do not want the cells to be =Template!A2 etc... I want them to reappear with the formula they had in the original before I hit the reset button.

I also have a format issue where all the cells have gray font. I want to keep my original formatting. Is there any way to do this?

Here is the after photo and the 2nd photo is the before I hit the reset button. I need the formulas to appear as they did in the 2nd photo. Any tips would be appreciated.

Portfolios


<TABLE style="PADDING-RIGHT: 2pt; PADDING-LEFT: 2pt; FONT-SIZE: 10pt; FONT-FAMILY: Tahoma,Arial; BACKGROUND-COLOR: #ffffff" cellSpacing=0 cellPadding=0 border=1><COLGROUP><COL style="FONT-WEIGHT: bold; WIDTH: 30px"><COL style="WIDTH: 53px"><COL style="WIDTH: 309px"></COLGROUP><TBODY><TR style="FONT-WEIGHT: bold; FONT-SIZE: 8pt; BACKGROUND-COLOR: #cacaca; TEXT-ALIGN: center"><TD></TD><TD>G</TD><TD>H</TD></TR><TR style="HEIGHT: 38px"><TD style="FONT-SIZE: 8pt; BACKGROUND-COLOR: #cacaca; TEXT-ALIGN: center">32</TD><TD style="COLOR: #ffff99; BACKGROUND-COLOR: #000000"></TD><TD style="COLOR: #ffff99; BACKGROUND-COLOR: #000000"></TD></TR><TR style="HEIGHT: 8px"><TD style="FONT-SIZE: 8pt; BACKGROUND-COLOR: #cacaca; TEXT-ALIGN: center">33</TD><TD style="FONT-SIZE: 5pt; COLOR: #ffff99; BACKGROUND-COLOR: #000000"></TD><TD style="FONT-SIZE: 5pt; COLOR: #ffff99; BACKGROUND-COLOR: #000000"></TD></TR><TR style="HEIGHT: 17px"><TD style="FONT-SIZE: 8pt; BACKGROUND-COLOR: #cacaca; TEXT-ALIGN: center">34</TD><TD style="FONT-WEIGHT: bold; COLOR: #808000"></TD><TD style="FONT-WEIGHT: bold; COLOR: #808000">Cash & Equivalents</TD></TR><TR style="HEIGHT: 17px"><TD style="FONT-SIZE: 8pt; BACKGROUND-COLOR: #cacaca; TEXT-ALIGN: center">35</TD><TD style="COLOR: #800000; BACKGROUND-COLOR: #c0c0c0"></TD><TD style="BACKGROUND-COLOR: #c0c0c0; TEXT-ALIGN: left">Money Market Funds</TD></TR><TR style="HEIGHT: 17px"><TD style="FONT-SIZE: 8pt; BACKGROUND-COLOR: #cacaca; TEXT-ALIGN: center">36</TD><TD style="COLOR: #808080; TEXT-ALIGN: center">1</TD><TD style="COLOR: #808080; TEXT-ALIGN: center">Wells Fargo Advantage Prime</TD></TR><TR style="HEIGHT: 10px"><TD style="FONT-SIZE: 8pt; BACKGROUND-COLOR: #cacaca; TEXT-ALIGN: center">37</TD><TD style="COLOR: #808080; TEXT-ALIGN: center">2</TD><TD style="COLOR: #808080; TEXT-ALIGN: center">0</TD></TR><TR style="HEIGHT: 17px"><TD style="FONT-SIZE: 8pt; BACKGROUND-COLOR: #cacaca; TEXT-ALIGN: center">38</TD><TD style="COLOR: #808080; TEXT-ALIGN: center">3</TD><TD style="COLOR: #808080; TEXT-ALIGN: center">0</TD></TR><TR style="HEIGHT: 17px"><TD style="FONT-SIZE: 8pt; BACKGROUND-COLOR: #cacaca; TEXT-ALIGN: center">39</TD><TD style="COLOR: #808080; TEXT-ALIGN: center">4</TD><TD style="COLOR: #808080; TEXT-ALIGN: center">Fixed Income</TD></TR><TR style="HEIGHT: 17px"><TD style="FONT-SIZE: 8pt; BACKGROUND-COLOR: #cacaca; TEXT-ALIGN: center">40</TD><TD style="COLOR: #808080; TEXT-ALIGN: center">5</TD><TD style="COLOR: #808080; TEXT-ALIGN: center">Investment Grade Bonds</TD></TR><TR style="HEIGHT: 17px"><TD style="FONT-SIZE: 8pt; BACKGROUND-COLOR: #cacaca; TEXT-ALIGN: center">41</TD><TD style="COLOR: #808080; TEXT-ALIGN: center">6</TD><TD style="COLOR: #808080; TEXT-ALIGN: center">SPEN - Corp Bonds</TD></TR><TR style="HEIGHT: 17px"><TD style="FONT-SIZE: 8pt; BACKGROUND-COLOR: #cacaca; TEXT-ALIGN: center">42</TD><TD style="COLOR: #808080; TEXT-ALIGN: center">7</TD><TD style="COLOR: #808080; TEXT-ALIGN: center">SPEN - Govt Agency Issues</TD></TR><TR style="HEIGHT: 17px"><TD style="FONT-SIZE: 8pt; BACKGROUND-COLOR: #cacaca; TEXT-ALIGN: center">43</TD><TD style="COLOR: #808080; TEXT-ALIGN: center">8</TD><TD style="COLOR: #808080; TEXT-ALIGN: center">Dodge & Cox Income</TD></TR><TR style="HEIGHT: 17px"><TD style="FONT-SIZE: 8pt; BACKGROUND-COLOR: #cacaca; TEXT-ALIGN: center">44</TD><TD style="COLOR: #808080; TEXT-ALIGN: center">9</TD><TD style="COLOR: #808080; TEXT-ALIGN: center">PIMCO Total Return </TD></TR><TR style="HEIGHT: 17px"><TD style="FONT-SIZE: 8pt; BACKGROUND-COLOR: #cacaca; TEXT-ALIGN: center">45</TD><TD style="COLOR: #808080; TEXT-ALIGN: center">10</TD><TD style="COLOR: #808080; TEXT-ALIGN: center">0</TD></TR><TR style="HEIGHT: 17px"><TD style="FONT-SIZE: 8pt; BACKGROUND-COLOR: #cacaca; TEXT-ALIGN: center">46</TD><TD style="COLOR: #808080; TEXT-ALIGN: center">11</TD><TD style="COLOR: #808080; TEXT-ALIGN: center">0</TD></TR><TR style="HEIGHT: 17px"><TD style="FONT-SIZE: 8pt; BACKGROUND-COLOR: #cacaca; TEXT-ALIGN: center">47</TD><TD style="COLOR: #808080; TEXT-ALIGN: center">12</TD><TD style="COLOR: #808080; TEXT-ALIGN: center">0</TD></TR><TR style="HEIGHT: 17px"><TD style="FONT-SIZE: 8pt; BACKGROUND-COLOR: #cacaca; TEXT-ALIGN: center">48</TD><TD style="COLOR: #808080; TEXT-ALIGN: center">13</TD><TD style="COLOR: #808080; TEXT-ALIGN: center">0</TD></TR><TR style="HEIGHT: 17px"><TD style="FONT-SIZE: 8pt; BACKGROUND-COLOR: #cacaca; TEXT-ALIGN: center">49</TD><TD style="COLOR: #808080; TEXT-ALIGN: center">14</TD><TD style="COLOR: #808080; TEXT-ALIGN: center">0</TD></TR></TBODY></TABLE>


<TABLE style="FONT-SIZE: 10pt; BORDER-LEFT-COLOR: #00ff00; BORDER-BOTTOM-COLOR: #00ff00; COLOR: #000000; BORDER-TOP-STYLE: groove; BORDER-TOP-COLOR: #00ff00; FONT-FAMILY: Arial; BORDER-RIGHT-STYLE: groove; BORDER-LEFT-STYLE: groove; BACKGROUND-COLOR: #fffcf9; BORDER-RIGHT-COLOR: #00ff00; BORDER-BOTTOM-STYLE: groove"><TBODY><TR><TD>Spreadsheet Formulas</TD></TR><TR><TD><TABLE style="FONT-SIZE: 9pt; FONT-FAMILY: Arial" cellSpacing=0 cellPadding=2 border=1><TBODY><TR style="FONT-SIZE: 10pt; BACKGROUND-COLOR: #cacaca"><TD>Cell</TD><TD>Formula</TD></TR><TR><TD>H34</TD><TD>=Models!C16</TD></TR><TR><TD>H35</TD><TD>=Models!C17</TD></TR><TR><TD>G36</TD><TD>=Template!G36</TD></TR><TR><TD>H36</TD><TD>=Template!H36</TD></TR><TR><TD>G37</TD><TD>=Template!G37</TD></TR><TR><TD>H37</TD><TD>=Template!H37</TD></TR><TR><TD>G38</TD><TD>=Template!G38</TD></TR><TR><TD>H38</TD><TD>=Template!H38</TD></TR><TR><TD>G39</TD><TD>=Template!G39</TD></TR><TR><TD>H39</TD><TD>=Template!H39</TD></TR><TR><TD>G40</TD><TD>=Template!G40</TD></TR><TR><TD>H40</TD><TD>=Template!H40</TD></TR><TR><TD>G41</TD><TD>=Template!G41</TD></TR><TR><TD>H41</TD><TD>=Template!H41</TD></TR><TR><TD>G42</TD><TD>=Template!G42</TD></TR><TR><TD>H42</TD><TD>=Template!H42</TD></TR><TR><TD>G43</TD><TD>=Template!G43</TD></TR><TR><TD>H43</TD><TD>=Template!H43</TD></TR><TR><TD>G44</TD><TD>=Template!G44</TD></TR><TR><TD>H44</TD><TD>=Template!H44</TD></TR><TR><TD>G45</TD><TD>=Template!G45</TD></TR><TR><TD>H45</TD><TD>=Template!H45</TD></TR><TR><TD>G46</TD><TD>=Template!G46</TD></TR><TR><TD>H46</TD><TD>=Template!H46</TD></TR><TR><TD>G47</TD><TD>=Template!G47</TD></TR><TR><TD>H47</TD><TD>=Template!H47</TD></TR><TR><TD>G48</TD><TD>=Template!G48</TD></TR><TR><TD>H48</TD><TD>=Template!H48</TD></TR><TR><TD>G49</TD><TD>=Template!G49</TD></TR><TR><TD>H49</TD><TD>=Template!H49</TD></TR></TBODY></TABLE></TD></TR></TBODY></TABLE>

Portfolios

<TABLE style="PADDING-RIGHT: 2pt; PADDING-LEFT: 2pt; FONT-SIZE: 10pt; FONT-FAMILY: Tahoma,Arial; BACKGROUND-COLOR: #ffffff" cellSpacing=0 cellPadding=0 border=1><COLGROUP><COL style="FONT-WEIGHT: bold; WIDTH: 30px"><COL style="WIDTH: 309px"></COLGROUP><TBODY><TR style="FONT-WEIGHT: bold; FONT-SIZE: 8pt; BACKGROUND-COLOR: #cacaca; TEXT-ALIGN: center"><TD> </TD><TD>H</TD></TR><TR style="HEIGHT: 38px"><TD style="FONT-SIZE: 8pt; BACKGROUND-COLOR: #cacaca; TEXT-ALIGN: center">32</TD><TD style="COLOR: #ffff99; BACKGROUND-COLOR: #000000"> </TD></TR><TR style="HEIGHT: 8px"><TD style="FONT-SIZE: 8pt; BACKGROUND-COLOR: #cacaca; TEXT-ALIGN: center">33</TD><TD style="FONT-SIZE: 5pt; COLOR: #ffff99; BACKGROUND-COLOR: #000000"> </TD></TR><TR style="HEIGHT: 17px"><TD style="FONT-SIZE: 8pt; BACKGROUND-COLOR: #cacaca; TEXT-ALIGN: center">34</TD><TD style="FONT-WEIGHT: bold; COLOR: #808000">Cash & Equivalents</TD></TR><TR style="HEIGHT: 17px"><TD style="FONT-SIZE: 8pt; BACKGROUND-COLOR: #cacaca; TEXT-ALIGN: center">35</TD><TD style="BACKGROUND-COLOR: #c0c0c0; TEXT-ALIGN: left">Money Market Funds</TD></TR><TR style="HEIGHT: 17px"><TD style="FONT-SIZE: 8pt; BACKGROUND-COLOR: #cacaca; TEXT-ALIGN: center">36</TD><TD style="TEXT-ALIGN: left">Wells Fargo Advantage Prime</TD></TR><TR style="HEIGHT: 18px"><TD style="FONT-SIZE: 8pt; BACKGROUND-COLOR: #cacaca; TEXT-ALIGN: center">37</TD><TD style="TEXT-ALIGN: left">0</TD></TR><TR style="HEIGHT: 10px"><TD style="FONT-SIZE: 8pt; BACKGROUND-COLOR: #cacaca; TEXT-ALIGN: center">38</TD><TD> </TD></TR><TR style="HEIGHT: 17px"><TD style="FONT-SIZE: 8pt; BACKGROUND-COLOR: #cacaca; TEXT-ALIGN: center">39</TD><TD style="FONT-WEIGHT: bold; COLOR: #993300">Fixed Income</TD></TR><TR style="HEIGHT: 17px"><TD style="FONT-SIZE: 8pt; BACKGROUND-COLOR: #cacaca; TEXT-ALIGN: center">40</TD><TD style="BACKGROUND-COLOR: #c0c0c0; TEXT-ALIGN: left">Investment Grade Bonds</TD></TR><TR style="HEIGHT: 17px"><TD style="FONT-SIZE: 8pt; BACKGROUND-COLOR: #cacaca; TEXT-ALIGN: center">41</TD><TD style="TEXT-ALIGN: left">SPEN - Corp Bonds</TD></TR><TR style="HEIGHT: 17px"><TD style="FONT-SIZE: 8pt; BACKGROUND-COLOR: #cacaca; TEXT-ALIGN: center">42</TD><TD style="TEXT-ALIGN: left">SPEN - Govt Agency Issues</TD></TR><TR style="HEIGHT: 17px"><TD style="FONT-SIZE: 8pt; BACKGROUND-COLOR: #cacaca; TEXT-ALIGN: center">43</TD><TD style="TEXT-ALIGN: left">Dodge & Cox Income</TD></TR><TR style="HEIGHT: 17px"><TD style="FONT-SIZE: 8pt; BACKGROUND-COLOR: #cacaca; TEXT-ALIGN: center">44</TD><TD style="TEXT-ALIGN: left">PIMCO Total Return </TD></TR><TR style="HEIGHT: 17px"><TD style="FONT-SIZE: 8pt; BACKGROUND-COLOR: #cacaca; TEXT-ALIGN: center">45</TD><TD style="TEXT-ALIGN: left">0</TD></TR><TR style="HEIGHT: 17px"><TD style="FONT-SIZE: 8pt; BACKGROUND-COLOR: #cacaca; TEXT-ALIGN: center">46</TD><TD style="TEXT-ALIGN: left">0</TD></TR><TR style="HEIGHT: 17px"><TD style="FONT-SIZE: 8pt; BACKGROUND-COLOR: #cacaca; TEXT-ALIGN: center">47</TD><TD style="TEXT-ALIGN: left">0</TD></TR><TR style="HEIGHT: 17px"><TD style="FONT-SIZE: 8pt; BACKGROUND-COLOR: #cacaca; TEXT-ALIGN: center">48</TD><TD style="TEXT-ALIGN: left">0</TD></TR><TR style="HEIGHT: 17px"><TD style="FONT-SIZE: 8pt; BACKGROUND-COLOR: #cacaca; TEXT-ALIGN: center">49</TD><TD style="TEXT-ALIGN: left">0</TD></TR></TBODY></TABLE>
<TABLE style="FONT-SIZE: 10pt; BORDER-LEFT-COLOR: #00ff00; BORDER-BOTTOM-COLOR: #00ff00; COLOR: #000000; BORDER-TOP-STYLE: groove; BORDER-TOP-COLOR: #00ff00; FONT-FAMILY: Arial; BORDER-RIGHT-STYLE: groove; BORDER-LEFT-STYLE: groove; BACKGROUND-COLOR: #fffcf9; BORDER-RIGHT-COLOR: #00ff00; BORDER-BOTTOM-STYLE: groove"><TBODY><TR><TD>Spreadsheet Formulas</TD></TR><TR><TD><TABLE style="FONT-SIZE: 9pt; FONT-FAMILY: Arial" cellSpacing=0 cellPadding=2 border=1><TBODY><TR style="FONT-SIZE: 10pt; BACKGROUND-COLOR: #cacaca"><TD>Cell</TD><TD>Formula</TD></TR><TR><TD>H34</TD><TD>=Models!C16</TD></TR><TR><TD>H35</TD><TD>=Models!C17</TD></TR><TR><TD>H36</TD><TD>=IFERROR(VLOOKUP(J36,'Sec ID'!$A$4:$Z$131,2,FALSE),"0")</TD></TR><TR><TD>H37</TD><TD>=IFERROR(VLOOKUP(J37,'Sec ID'!$A$4:$Z$131,2,FALSE),"0")</TD></TR><TR><TD>H39</TD><TD>=Models!Q18</TD></TR><TR><TD>H40</TD><TD>=Models!Q19</TD></TR><TR><TD>H41</TD><TD>=IFERROR(VLOOKUP(J41,'Sec ID'!$A$4:$Z$131,2,FALSE),"0")</TD></TR><TR><TD>H42</TD><TD>=IFERROR(VLOOKUP(J42,'Sec ID'!$A$4:$Z$131,2,FALSE),"0")</TD></TR><TR><TD>H43</TD><TD>=IFERROR(VLOOKUP(J43,'Sec ID'!$A$4:$Z$131,2,FALSE),"0")</TD></TR><TR><TD>H44</TD><TD>=IFERROR(VLOOKUP(J44,'Sec ID'!$A$4:$Z$131,2,FALSE),"0")</TD></TR><TR><TD>H45</TD><TD>=IFERROR(VLOOKUP(J45,'Sec ID'!$A$4:$Z$131,2,FALSE),"0")</TD></TR><TR><TD>H46</TD><TD>=IFERROR(VLOOKUP(J46,'Sec ID'!$A$4:$Z$131,2,FALSE),"0")</TD></TR><TR><TD>H47</TD><TD>=IFERROR(VLOOKUP(J47,'Sec ID'!$A$4:$Z$131,2,FALSE),"0")</TD></TR><TR><TD>H48</TD><TD>=IFERROR(VLOOKUP(J48,'Sec ID'!$A$4:$Z$131,2,FALSE),"0")</TD></TR><TR><TD>H49</TD><TD>=IFERROR(VLOOKUP(J49,'Sec ID'!$A$4:$Z$131,2,FALSE),"0")</TD></TR></TBODY></TABLE></TD></TR></TBODY></TABLE>

Excel tables to the web >> http://www.excel-jeanie-html.de/index.php?f=1" target="_blank"> Excel Jeanie HTML 4
 
Last edited:

Excel Facts

What does custom number format of ;;; mean?
Three semi-colons will hide the value in the cell. Although most people use white font instead.

Forum statistics

Threads
1,215,107
Messages
6,123,126
Members
449,097
Latest member
mlckr

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