This one is coming right over the plate

Roccofan

Board Regular
Joined
Apr 18, 2002
Messages
61
I hope this is an easy one:

I copied the following lines of code from one macro in a work book and pasted it into another workbook:

These lines find a particular number format
Application.FindFormat.Clear
Application.FindFormat.NumberFormat = _
"_(* #,##0_);_(* (#,##0);_(* ""-""_);_(@_)"

'The following lines replace that number format with numbers rounded to "Thousands"
Application.ReplaceFormat.Clear
Application.ReplaceFormat.NumberFormat = "#,##0,_);(#,##0,);-"

When I run the macro in the new sheet I get an error message that says "Application defined or object defined error". Keep in mind that the exact same code works fine in another workbook. There are other lines of code that perfrom other tasks, but I've isolated those and this is the only one that gives me trouble. Let me know if you need any further explanation.

RF
 

Excel Facts

Workdays for a market open Mon, Wed, Friday?
Yes! Use "0101011" for the weekend argument in NETWORKDAYS.INTL or WORKDAY.INTL. The 7 digits start on Monday. 1 means it is a weekend.
well since nobody else has had ago i might as well. The FindFormat part is not recognised and there might be a braket missing from the format part. Maybe the other workbook has access to an addin or function that recognises FindFormat the new workbook doesn't have. Stab in the dark but you never you know

cheers
 
Upvote 0
Try this...

"#,##0,_);(#,##0,);""-"""


For more on custom number formatting see the Excel Help topic for "Create a custom number format".
This message was edited by Mark W. on 2002-08-22 13:54
 
Upvote 0
Thanks guys, but niether of those worked. In order to get the original code, I recorded the macro while using the new format find and replace function in Office XP. Both spreadsheets were done in the same version.

Mark W.- I'm glad to see you're alive, kicking, and still full of helpful idea's. :smile:

RF
 
Upvote 0

Forum statistics

Threads
1,224,885
Messages
6,181,586
Members
453,055
Latest member
cope7895

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