-
WSchipshot
AskWoody LoungerI’ve never worked with Autofilters in VBA so I’ve never seen those objects, properties, or methods, but that function is way cool.
-
WSchipshot
AskWoody LoungerI’ve never worked with Autofilters in VBA so I’ve never seen those objects, properties, or methods, but that function is way cool.
-
WSchipshot
AskWoody LoungerHans,
My VBA doesn’t seem to recognize calculatefull. I’ve previously looked for a VBA equivalent to ctrl-alt-f9, but I’ve never found one.The TIMER function is cleaner than using NOW. However, it seems TIMER won’t work if the execution of your code is executing at midnight.
-
WSchipshot
AskWoody LoungerHans,
My VBA doesn’t seem to recognize calculatefull. I’ve previously looked for a VBA equivalent to ctrl-alt-f9, but I’ve never found one.The TIMER function is cleaner than using NOW. However, it seems TIMER won’t work if the execution of your code is executing at midnight.
-
WSchipshot
AskWoody LoungerWell, believe it or not, I have been following this discussion. While it seems to have drifted a little off topic, I believe I understand the arguments for declaring variables. I do have some computer science in my academic background, but I have never been a programmer. I’m the kind of guy that everyone else comes to for Excel help. Since I don’t normally create “applications” with dozens and dozens of lines of code which are hard to debug, I consider the arguments in favor of Option Explicit to be a bit esoteric and the benefits minimal. I think I write well-organized code and I don’t see how declaring variables would improve that. As one poster said, a real programmer would know all the needed variables before writing a single line of code. That may be true, but for my scale of project, I don’t think that kind of upfront analysis is time well-spent. The next time I embark on something with a larger scale, I’ll declare my variables. For my usual utility macros for PERSONAL.XLS or custom functions, I think I’ll continue in my slothful ways.
I would add another benefit to declaring variables: you automatically get your intended cApiTaliZATIon each time you use the variable.
Thanks to everyone for your input.
-
WSchipshot
AskWoody LoungerWell, believe it or not, I have been following this discussion. While it seems to have drifted a little off topic, I believe I understand the arguments for declaring variables. I do have some computer science in my academic background, but I have never been a programmer. I’m the kind of guy that everyone else comes to for Excel help. Since I don’t normally create “applications” with dozens and dozens of lines of code which are hard to debug, I consider the arguments in favor of Option Explicit to be a bit esoteric and the benefits minimal. I think I write well-organized code and I don’t see how declaring variables would improve that. As one poster said, a real programmer would know all the needed variables before writing a single line of code. That may be true, but for my scale of project, I don’t think that kind of upfront analysis is time well-spent. The next time I embark on something with a larger scale, I’ll declare my variables. For my usual utility macros for PERSONAL.XLS or custom functions, I think I’ll continue in my slothful ways.
I would add another benefit to declaring variables: you automatically get your intended cApiTaliZATIon each time you use the variable.
Thanks to everyone for your input.
-
WSchipshot
AskWoody LoungerYou might try Range(“A”+format(i,”#”)+”:C”+format(i,”#”))
-
WSchipshot
AskWoody LoungerYou might try Range(“A”+format(i,”#”)+”:C”+format(i,”#”))
-
WSchipshot
AskWoody LoungerWell, this is pretty ugly but maybe this will work for you.
I typed 1/1/2003 in A1. In cell B1, I typed =”=text(“&CELL(“address”,A1)&”,””mm/yyy””)”
A1 looks like: 1-Jan . B1 looks like: =text($A$1,”mm/yyy”)
If I now save the workbook as a csv file and reopen it in Excel, A1 still looks like: 1-Jan. B1 looks like: 01/2003
-
WSchipshot
AskWoody LoungerI think you’re not just copying the last occurrence into sheet2!a1.c1, but actually copying all occurences. So naturally you only see the last one.
I haven’t tested this but I think you can just modify your original code as follows:
Private Sub cmdSendMac_Click()
Dim RowCount As Integer
Dim Choice As Integer
Dim i As Integer
RowCount = Range(“A1”).End(xlDown).RowRange(“A1:C1”).Select
i=0
For Choice = 1 To RowCountActiveCell.Offset(1, 0).Select
If ActiveCell.Font.Color = RGB(0, 0, 0) And ActiveCell.Value “” Then
i=i+1
ActiveCell.Copy Destination:=Worksheets(“Sheet2”).Range(“A”+i+”:C”+i)Else
End If
Next Choice
End Sub
-
WSchipshot
AskWoody LoungerI think you’re not just copying the last occurrence into sheet2!a1.c1, but actually copying all occurences. So naturally you only see the last one.
I haven’t tested this but I think you can just modify your original code as follows:
Private Sub cmdSendMac_Click()
Dim RowCount As Integer
Dim Choice As Integer
Dim i As Integer
RowCount = Range(“A1”).End(xlDown).RowRange(“A1:C1”).Select
i=0
For Choice = 1 To RowCountActiveCell.Offset(1, 0).Select
If ActiveCell.Font.Color = RGB(0, 0, 0) And ActiveCell.Value “” Then
i=i+1
ActiveCell.Copy Destination:=Worksheets(“Sheet2”).Range(“A”+i+”:C”+i)Else
End If
Next Choice
End Sub
-
WSchipshot
AskWoody LoungerNewtonian iterations typically reach an answer within very few iterations (i.e. 5). If Excel hasn’t reached an answer in 100 iterations, it’s never going to get one.
It’s not that there’s a threshhold of X at which point the iteration process fails. You have a “small” number and that makes the iteration process susceptible to failure.
If you really want to use the YIELD function, just change the formula in F3 from =YIELD(B3,C3,0,D3,1,2,1) to =YIELD(B3,C3,0,100*D3,100,2,1) and copy that down.
-
WSchipshot
AskWoody LoungerNewtonian iterations typically reach an answer within very few iterations (i.e. 5). If Excel hasn’t reached an answer in 100 iterations, it’s never going to get one.
It’s not that there’s a threshhold of X at which point the iteration process fails. You have a “small” number and that makes the iteration process susceptible to failure.
If you really want to use the YIELD function, just change the formula in F3 from =YIELD(B3,C3,0,D3,1,2,1) to =YIELD(B3,C3,0,100*D3,100,2,1) and copy that down.
-
WSchipshot
AskWoody LoungerIf you multiply your price by 100 and set your redemption value to 100, you get a valid answer.
In the Excel help, it says the YIELD function uses Newtonian iterations to get its answer. Newtonian iterations operate by starting with an initial guess at the yield. It then calcs a price from the cashflows you’ve specified. If the calc’d price is different from your specified price, it determines whether to adjust its guess up or down. It will continue this process until the calc’d price is “sufficiently close” to the specified price. The criteria for sufficiently close is usually abs(calc’d price-specified price)/specified price. So if specified price is small (as it is in your original example), the allowable error is very small and Excel may not be able to reach a satisfactory answer prior to 100 iterations.
BTW, because your examples do not have any coupon payments, the formula I’ve added in my attachment presents a closed form solution (i.e. can be directly calc’d without going through an iterative process which always introduces some error). While we’re definitely splitting hairs, my formula is more accurate than yours.
This was done in Excel 2002 SP-1.
-
WSchipshot
AskWoody LoungerIf you multiply your price by 100 and set your redemption value to 100, you get a valid answer.
In the Excel help, it says the YIELD function uses Newtonian iterations to get its answer. Newtonian iterations operate by starting with an initial guess at the yield. It then calcs a price from the cashflows you’ve specified. If the calc’d price is different from your specified price, it determines whether to adjust its guess up or down. It will continue this process until the calc’d price is “sufficiently close” to the specified price. The criteria for sufficiently close is usually abs(calc’d price-specified price)/specified price. So if specified price is small (as it is in your original example), the allowable error is very small and Excel may not be able to reach a satisfactory answer prior to 100 iterations.
BTW, because your examples do not have any coupon payments, the formula I’ve added in my attachment presents a closed form solution (i.e. can be directly calc’d without going through an iterative process which always introduces some error). While we’re definitely splitting hairs, my formula is more accurate than yours.
This was done in Excel 2002 SP-1.
![]() |
Patch reliability is unclear, but widespread attacks make patching prudent. Go ahead and patch, but watch out for potential problems. |
SIGN IN | Not a member? | REGISTER | PLUS MEMBERSHIP |

Plus Membership
Donations from Plus members keep this site going. You can identify the people who support AskWoody by the Plus badge on their avatars.
AskWoody Plus members not only get access to all of the contents of this site -- including Susan Bradley's frequently updated Patch Watch listing -- they also receive weekly AskWoody Plus Newsletters (formerly Windows Secrets Newsletter) and AskWoody Plus Alerts, emails when there are important breaking developments.
Get Plus!
Welcome to our unique respite from the madness.
It's easy to post questions about Windows 11, Windows 10, Win8.1, Win7, Surface, Office, or browse through our Forums. Post anonymously or register for greater privileges. Keep it civil, please: Decorous Lounge rules strictly enforced. Questions? Contact Customer Support.
Search Newsletters
Search Forums
View the Forum
Search for Topics
Recent Topics
-
France : A law requiring messaging apps to implement a backdoor ..
by
Alex5723
4 hours, 37 minutes ago -
Dev runs Windows 11 ARM on an iPad Air M2
by
Alex5723
5 hours, 26 minutes ago -
MS-DEFCON 3: Cleanup time
by
Susan Bradley
27 minutes ago -
KB5056686 (.NET v8.0.15) Delivered Twice in April 2025
by
lmacri
51 minutes ago -
How to enable Extended Security Maintenance on Ubuntu 20.04 LTS before it dies
by
Alex5723
16 hours, 40 minutes ago -
Windows 11 Insider Preview build 26200.5562 released to DEV
by
joep517
20 hours, 38 minutes ago -
Windows 11 Insider Preview build 26120.3872 (24H2) released to BETA
by
joep517
20 hours, 40 minutes ago -
Unable to eject external hard drives
by
Robertos42
6 minutes ago -
Saying goodbye to not-so-great technology
by
Susan Bradley
4 hours, 31 minutes ago -
Tech I don’t miss, and some I do
by
Will Fastie
1 hour, 43 minutes ago -
Synology limits hard drives
by
Susan Bradley
2 days ago -
Links from Microsoft 365 and from WhatsApp not working
by
rog7
1 day, 3 hours ago -
WhatsApp Security Advisories CVE-2025-30401
by
Alex5723
2 days, 6 hours ago -
Upgrade Sequence
by
doneager
2 days ago -
Chrome extensions with 6 million installs have hidden tracking code
by
Nibbled To Death By Ducks
5 hours, 51 minutes ago -
Uninstall “New Outlook” before installing 2024 Home & Business?
by
Tex265
23 hours, 5 minutes ago -
The incredible shrinking desktop icons
by
Thumper
3 days, 4 hours ago -
Windows 11 Insider Preview Build 22635.520 (23H2) released to BETA
by
joep517
3 days, 5 hours ago -
Connecting hard drive on USB 3.2 freezes File Explorer & Disk Management
by
WSJMGatehouse
4 hours, 36 minutes ago -
Shellbag Analyser & Cleaner Update
by
Microfix
1 day, 14 hours ago -
CISA warns of increased breach risks following Oracle Cloud leak
by
Nibbled To Death By Ducks
3 days, 14 hours ago -
Outlook 2024 two sent from email addresses
by
Kathy Stevens
2 days, 19 hours ago -
Speeding up 11’s search
by
Susan Bradley
1 day, 3 hours ago -
HP Pavilion Will Not Wake Up After Being Idle for Longer Period
by
WSwalterwood44
1 day, 15 hours ago -
Make a Windows 11 Local Account Passwordless
by
Drcard:))
4 days, 4 hours ago -
Ubuntu 25.04 (Plucky Puffin)
by
Alex5723
4 days, 12 hours ago -
24H2 fixed??
by
CWBillow
3 days, 4 hours ago -
Uninstalr Updates
by
jv16
4 days, 17 hours ago -
Apple zero days for April
by
Susan Bradley
14 hours, 10 minutes ago -
CVE program gets last-minute funding from CISA – and maybe a new home
by
Nibbled To Death By Ducks
3 days, 15 hours ago
Recent blog posts
Key Links
Want to Advertise in the free newsletter? How about a gift subscription in honor of a birthday? Send an email to sb@askwoody.com to ask how.
Mastodon profile for DefConPatch
Mastodon profile for AskWoody
Home • About • FAQ • Posts & Privacy • Forums • My Account
Register • Free Newsletter • Plus Membership • Gift Certificates • MS-DEFCON Alerts
Copyright ©2004-2025 by AskWoody Tech LLC. All Rights Reserved.