Macro that will insert a simple text string in top cell of text file


F

fred.sheriff

I am building a macro in Access but i have hit a snag since fields cannot be titled more than 64 characters. So now I need to come up with some VBA that will simply insert text into cell A1 of a closed file.

I need for the top right cell (i.e., Cell A1) to read:

"Action (SiteID=US|Country=US|Currency=USD|ListingType=Half|Location=US|ListingDuration=GTC)"

I am hoping to build a separate macro that will insert the below text in cell A1 of this file. The file it titled: 007_HalfFileAV2.txt. I can either delete and paste over the existing text in cell A1 (which shows the truncated first 64 characters, i.e., "Action (SiteID=US|Country=US|Currency=USD|ListingType=Half|Locat", or I can add the missing "ion=US|ListingDuration=GTC)" to the end of the truncated text.....whichever is easier.

Is there some straightforward VBA code that I can add to an excel workbook that will accomplish this? I don't have VBA experience with Access but thatwould be another option. Thanks for any direction, code, etc that you can provide.
 
Ad

Advertisements

G

GS

I am building a macro in Access but i have hit a snag since fields
cannot be titled more than 64 characters. So now I need to come up
with some VBA that will simply insert text into cell A1 of a closed
file.

I need for the top right cell (i.e., Cell A1) to read:

"Action
(SiteID=US|Country=US|Currency=USD|ListingType=Half|Location=US|ListingDuration=GTC)"

I am hoping to build a separate macro that will insert the below text
in cell A1 of this file. The file it titled: 007_HalfFileAV2.txt. I
can either delete and paste over the existing text in cell A1 (which
shows the truncated first 64 characters, i.e., "Action
(SiteID=US|Country=US|Currency=USD|ListingType=Half|Locat", or I can
add the missing "ion=US|ListingDuration=GTC)" to the end of the
truncated text.....whichever is easier.

Is there some straightforward VBA code that I can add to an excel
workbook that will accomplish this? I don't have VBA experience with
Access but that would be another option. Thanks for any direction,
code, etc that you can provide.

Why not simply open the file in Excel?

Otherwise...
What is your task using Access, and why are you using Excel?
Why does your data structure violate database rules?

--
Garry

Free usenet access at http://www.eternal-september.org
Classic VB Users Regroup!
comp.lang.basic.visual.misc
microsoft.public.vb.general.discussion
 

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