LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default how do I debug my Excel macro & make it actually WORK?

Here's the ever-so-simple task... use a macro to add two cells in a range,
all with numerical values - two crummy cells! And then get the result in a
new row (right under the cells in question) in bold text. 2 cells!! Wiith
simple numbers in them!!

Luckily they are in the same column in the same workbook! Whew... that
makes it sooo easy, don't it?

However... it has been a long time since I've used an Excel macro, and I
forgot how I solved this before. It took me hours of trial & error & futility
before, trying to use MS Help in Excel, online, and in Visual basic debugger,
etc. Eventually trial & error won out.

(can't microsoft just tell you how to fix this stuff when it doesn't work? -
a bunch of simple examples, maybe???? - nutty idea, a debugger that accept
requests in simple english, is interactive if necessary, and will solve your
problem in less than 6 hours??)

The problem is that when I use the macro, it assigns a fixed range for the
cells I want to add up. I can't run the macro again, because the darn thing
WON'T WORK (BYW, not shouting - using caps for emphasis)... here's the code:

Sub Macro7()
'
' Macro7 Macro
' Macro recorded 2/15/2006 by mark.diaz
'
' Keyboard Shortcut: Ctrl+z
'
Selection.EntireRow.Insert
Range("C24:C26").Select
Range("C26").Activate
ActiveCell.FormulaR1C1 = "=SUM(R[-2]C:R[-1]C)"
Range("C26").Select
Selection.Font.Bold = True
End Sub

As you can see the range for the cells is "fixed" - my term, because I don't
know what else to call it.

What I REALLY want to do is set set the cursor at the lower of the 2 (wild
thought, maybe even 3 or 4) cells, then hit Ctrl-z, and have the macro open a
new row witht he sum in bold text. That's the super simple macro.

Ideally, I would like to have a loop with 5 or 6 sets of 2-cell groups, and
have them all totaled up in bold.

is this too much to ask?

I have been working on this problem off and on since 11 AM, and it's now 5
PM. That's 6 hours for the numerically challenged.

I can't believe how difficult microsoft makes it to adapt their macros to do
the simplest tasks. I find it humiliating and frustrating to be defeated by
software that claims to be useful.

At any rate, if you can help me with this, I will be eternally grateful - or
at least until I try to write my next macro...

Mark
Boston, MA
direct:

 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Macro sends Excel file by Outlook - works in debug - not realt Prabha Excel Programming 2 December 8th 05 02:18 PM
How do I resolve debug error macro Excel 2000? At least, any lead Excel 2000 Macros debugger Excel Discussion (Misc queries) 5 October 25th 05 08:56 AM
How do I make a macro work in one worksheet only Hawkfan757 Excel Programming 1 January 11th 05 05:43 PM
Macro Debug tcnichols Excel Programming 4 July 22nd 04 06:18 PM
Macro to make a cell work like a check Logan[_2_] Excel Programming 2 February 3rd 04 04:11 AM


All times are GMT +1. The time now is 06:06 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"