problems with the VBA book

smokenack

Active Member
Joined
Dec 12, 2003
Messages
351
I have recently purchased the VBA and MACROS for microsoft excel book. Would it be appropriate to post any problems that I encounter here? I am an absolute beginner and am sure that some of my queries will appear foolish but I can handle the ridicule.
e.g

the following code on page 66 only works for the first zero in the list, not as suggested for all zeros encountered

Set Rng = Range("B1:B16").Find(What:=0, LookAt:=xlWhole, LookIn:=xlValues)
Rng.Offset(, 1).Value = "LOW"

thanks

Nick
 

Excel Facts

Repeat Last Command
Pressing F4 adds dollar signs when editing a formula. When not editing, F4 repeats last command.
Nick

You shoukd post in the main Excel forum.

What are you actually trying to do with the code?

Do you actually need code? Could you not use the IF worksheet function?
 
I'm not actually using the code for anything, just working my way through the book, trying out the code as I go and seeing if I understand. In this case yes I would normally use the IF function.

Nick
 
Hi Nick,

A couple of quick comments:

1. The text to which you refer on p66 of the book says "Find any total equal to zero and place LOW in the cell next to it."

I read this as meaning find the first cell containing zero, but on a further reading I can see how you may have interpreted it in the way that you have. Rest assured, you are not doing anything wrong - that code will only detect the first cell satisfying the Find criteria.

2. The page that you quote is using the code as an example of the use of Offset. If you are interested in the idea of finding all of the zeroes using Find then have a look at FindNext in the VBE Help files - there is an example there.

I think queries relating specifically to the book are fine posted here. For general Excel and/or VBA queries use the main Excel forum, as Norie suggests.

HTH
 
Thanks Ritchie. I'm going to have to nag the IT dept to install the help files.

Nick
 
Nick, this is a good place to post any questions about code SPECIFIC to the book. If you are trying to modify book code for yourself, then the Excel Questions forum would be better. But for question/comments about the book, as you posted here - this is the forum.

Thank you for posting your question. You're right - the code doesn't work as stated. It's incomplete, a loop would be required to mark all the zero value cases. We'll see about getting this fixed in the next edition.

I'm wondering - do you know what revision you have? Look at page 7 - is there a link posted there? If not, then you have a first edition. Since then, some fixed have been made. Also, many files (and a few extras) are available for download. If you need access to the, please PM and we'll see about getting you the files.
 
Yes there is a link on page 7 of my book and I've downloaded the files.
Thanks for your help

Nick
 
Hi, I looked at the original transcript and my technical notes to the editor, and smokenack is absolutely correct. I did not catch that wording ("Find any total equal to zero...") as being inconsistent with the code example of only finding the first (if it existed) instance of a zero. Thanks for pointing that out.
 

Forum statistics

Threads
1,215,459
Messages
6,124,947
Members
449,198
Latest member
MhammadishaqKhan

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