Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Macro sends Excel file by Outlook - works in debug - not realt | Excel Programming | |||
How do I resolve debug error macro Excel 2000? At least, any lead | Excel Discussion (Misc queries) | |||
How do I make a macro work in one worksheet only | Excel Programming | |||
Macro Debug | Excel Programming | |||
Macro to make a cell work like a check | Excel Programming |