LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
Sam Sam is offline
external usenet poster
 
Posts: 699
Default replace method using ReplaceFormat .....

Hi again,

wow. has been a long time since i last wrote to these boards.

here is my issue (read it on MSDN: http://support.microsoft.com/kb/823222)

i have an access report to export to excel. i am doing it a bit different
than whats described in the article above. basically i have a report, my code
exports it to Word, and then copy/paste it to excel and then it's modified in
excel. ok, so i have one field that is text and comes in as a number when its
pasted into excel. the way around it is to have that cell in access equal to:
="'" & [fieldName], so i concatenate the ' to the field. if you do the
following in excel it will not work. find/replace ' with nothing, the cell
will automatically format itself to a number.

so i have a way around it. when i extend the replace dialog screen i can add
the replaceformat. so in excel (w/o using vba) its simple. i add the format
as text and " " in the replace box and it works wonderfully. however, here is
my dilema, i don't know how to do this in VBA. i tried looking for online
help, and nothing. here is my code:


Code:
With MySheet.Range("C1:D500")
.Select
.Replace What:="'", Replacement:="", ReplaceFormat:=?????
End Withi tried adding ReplaceFormat:="Text" and it didn't work. anybody
know how this works??

please help,

Thanks,

Sam
 
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
Replaceformat problem davethewelder Excel Discussion (Misc queries) 2 March 3rd 08 05:08 PM
Replace method problems Liz Excel Programming 3 June 14th 07 04:43 PM
Problems ReplaceFormat - error 1004 ndsykes Excel Programming 2 March 19th 07 05:16 PM
Replace method - cannot find any data to replace Mike Excel Programming 5 April 6th 06 08:56 PM
SearchFormat and ReplaceFormat Mike Excel Programming 1 October 24th 05 02:38 PM


All times are GMT +1. The time now is 05:09 PM.

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

About Us

"It's about Microsoft Excel"