Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.office.misc,microsoft.public.excel.programming
external usenet poster
 
Posts: 1,231
Default VB Macro in Excel 2007

asimmons wrote...
I frequently need to format excel reports that show no values after a
decimal point if it is a two digit number and one value after the
decimal point if it is a single digit number. *For example... 3.12,
20.78, -1.22 and -10.55 would be displayed 3.1, 21, (1), and (11). *I
have created a macro that does this for numbers I type in however when I
try to expand it to select cells in my reports, I get an error code that
says 400. *I'm not sure if I have the parameters set wrong or if it is
because the report cells are referencing formulas. *I have attached my
code. *Anybody have suggestions????

....

How big is your selection? If it's very big, it's possible you're
blowing through Excel's object model's limits on the number of areas
in a multiple area range. You may have to iterate through your
selection in smaller size chunks.

BTW, it'd be better to post this sort of question to the
microsoft.public.excel.programming newsgroup rather than this one. I'm
crossposting to microsoft.public.excel.programming and setting the
follow-up tag to that newsgroup.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 135
Default VB Macro in Excel 2007

On May 11, 8:03*pm, Harlan Grove wrote:
asimmons wrote...
I frequently need to format excel reports that show no values after a
decimal point if it is a two digit number and one value after the
decimal point if it is a single digit number. *For example... 3.12,
20.78, -1.22 and -10.55 would be displayed 3.1, 21, (1), and (11). *I
have created a macro that does this for numbers I type in however when I
try to expand it to select cells in my reports, I get an error code that
says 400. *I'm not sure if I have the parameters set wrong or if it is
because the report cells are referencing formulas. *I have attached my
code. *Anybody have suggestions????


...

How big is your selection? If it's very big, it's possible you're
blowing through Excel's object model's limits on the number of areas
in a multiple area range. You may have to iterate through your
selection in smaller size chunks.

BTW, it'd be better to post this sort of question to the
microsoft.public.excel.programming newsgroup rather than this one. I'm
crossposting to microsoft.public.excel.programming and setting the
follow-up tag to that newsgroup.


Harlan,

The cross post to microsoft.public.excel.programming did not bring
over your code. Please post the code to the aforementioned group.

Best,

Matthew Herbert
Reply
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
Excel 2007 Macro MacroIssue Excel Discussion (Misc queries) 1 August 27th 09 03:47 PM
macro in excel 2007 Tillie New Users to Excel 1 December 6th 08 06:18 AM
Excel 2007 Macro Help (Excel 2003 not working in 2007) Pman Excel Discussion (Misc queries) 4 May 29th 08 06:29 PM
In Excel 2007 how to switch off macro with a macro Micky Excel Programming 2 September 24th 07 11:17 PM
Macro Help Needed - Excel 2007 - Print Macro with Auto Sort Gavin Excel Worksheet Functions 0 May 17th 07 01:20 PM


All times are GMT +1. The time now is 09:45 AM.

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

About Us

"It's about Microsoft Excel"