Find/Replace Macro

S

Shirley

I am building a macro to find and replace zeros (0) that are imported from
Excel (blank cells). I have used a combination of Select Object, RunCommands
and SendKeys to accomplish this action. It seems to work up to the point of
"REPLACE ALL" I can't find an action that would force "ENTER" to complete
the action. Any thoughts would be appreciated!
 
J

Jerry Whittle

Don't use Find/Replace. Instead create an update query that will fix it.

Or just leave the table as is and deal with the null values as needed.
Something like the NZ function can convert the nulls to 0 easily in a query.
 
J

John W. Vinson

I am building a macro to find and replace zeros (0) that are imported from
Excel (blank cells). I have used a combination of Select Object, RunCommands
and SendKeys to accomplish this action. It seems to work up to the point of
"REPLACE ALL" I can't find an action that would force "ENTER" to complete
the action. Any thoughts would be appreciated!

WHOA!!!!

You're using the wrong tool for the job. A very simple Update query will do
the job. No macro and no code are needed.

What do you want updated, and what do you want it updated to? Did you import
blanks (Nulls) and need them set to zero or vice versa? A Query can do
either; a Macro can too, but it's much slower, much more complex, and not the
right way to go.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top