Formatting Excel spreadsheets, part II

drjekyll325

New Member
Joined
Dec 30, 2003
Messages
24
Hi everyone,

I have an Excel spreadsheet that I am using Access 97 VBA to manipulate. I can't get the find-and-replace functionality to work, even though I have used the VBA code from an Excel macro, only modifying the object reference. Specifically, I am trying to replace all cells that = "0" in a range of columns to be blanked out.

Any suggestions?
 

Excel Facts

Test for Multiple Conditions in IF?
Use AND(test, test, test, test) or OR(test, test, test, ...) as the logical_test argument of IF.
I have an Excel spreadsheet that I am using Access 97 VBA to manipulate

Why are using Access 97 VBA to manipulate it instead of using Excel VBA directly?

Anyway, another option, which may or may not work for you: Instead of replacing all the zeroes, can you simply change the format to display zeroes as blanks?
 
Upvote 0
Why are using Access 97 VBA to manipulate it instead of using Excel VBA directly?
Because the spreadsheet is generated by an Access application.

Anyway, another option, which may or may not work for you: Instead of replacing all the zeroes, can you simply change the format to display zeroes as blanks?
I couldn't find any format options to do this. Any suggestions?


Anyway, it's my belief the following code should work just fine:
objSchedule.Columns("G:AH").Replace("0", "", xlWhole, xlByRows, False)

What am I missing?
 
Upvote 0
I have written a lot of Excel VBA code, and a lot of Access VBA code, but have not written code from one to another, so I am afraid I can't help you there.

However, instead of creating the Excel spreadsheet in Access, it is possible to create a pre-formatted Excel template that you can drop/export the Access data to? I am not sure how to do this, but just though tI would toss that idea out there...
 
Upvote 0

Forum statistics

Threads
1,214,826
Messages
6,121,793
Members
449,048
Latest member
greyangel23

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