ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Macro that will insert a simple text string in top cell of text file (https://www.excelbanter.com/excel-programming/450393-macro-will-insert-simple-text-string-top-cell-text-file.html)

[email protected]

Macro that will insert a simple text string in top cell of text file
 
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=Hal f|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=Hal f|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.

GS[_2_]

Macro that will insert a simple text string in top cell of text file
 
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=Hal f|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=Hal f|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




All times are GMT +1. The time now is 07:17 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com