VBA is a great tool for handling repetative tasks. As a general rule,
I would develop worksheet functions in C / C++ (for performance and to
interface with other tools ... such as databases or web services). VBA
would be used to show/hide sheets, copy data, save files, toggle
setting.
First thing you should know is that Excel has a Tools -> Macros ->
Record Macro feature that builds a (poor) VBA skeleton for whatever
tasks you wish to do. One note is that this code sometimes does not
work if you edit it ! This can make VBA a little frustrating. But it
is a great macro language and this feature is invaluable in guiding you
though the feature maze. You would need to clean up hard-coded ranges
/ worksheet names... Use the Sheet (id).select, SelectedCell.offset,
to navigate. When coping ranges, use range("theTarget').value =
range("theSource").value When analyzing range values pass the range
data to a variable dim a a = range("theData").value rows
= a.ubound(1) cols = a.ubound(2) you can also then re-populate
the range quickly with range("theData").value = a
But do not write heavy duty functions in VBA. Use C / C++ for any
number manipulations, sorting, grouping, .... When building
worksheet functions, use the C / C++ API or a tool to make this work
easier.
RapidXLL_NET automatically interfaces native C / C++ with Excel Add-Ins
and the .NET framework. Visit
http://www.RapidXLL.net for samples
and a free trial.
Sincerely,
The RapidXLL Team
(E-Mail Removed) wrote:
> Hey - I consider myself pretty good with Excel (not an expert or
> anything, but know most of the functions and options available within
> Excel inside out) but don't know a thing about Visual Basic
> programming. Can someone recommend a good introductory book where
> someone with a good knowledge of Excel can pick up at least the basics
> behind VBA programming in Excel? I have programming experience (C, C++,
> SAS) and I think it is something I pick up pretty quickly, just none in
> Visual Basic. So if anyone can recommend me a good book to start with
> that would be appreciated, thanks!!!