Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
GolfGal
 
Posts: n/a
Default adding apostrophe macro?

I download a .csv sheet daily, open & save as excel, and link to access.
However, access returns some #Num errors. I need to convert several of the
columns to text, from what I read by adding apostrophe. Is there a macro
that I can run on certain columns that will add an apostrophe in front of
all? There are 7000 lines, so doing it manually is not possible.

Thanks

  #2   Report Post  
Paul B
 
Posts: n/a
Default

Golf, here is one way

Sub add_apostrophe()
'will add an ' in front of whats in the used range in column A
Set rng = Intersect(Range("A:A"), ActiveSheet.UsedRange)
For Each c In rng
c.Value = "'" & c
Next
End Sub


--
Paul B
Always backup your data before trying something new
Please post any response to the newsgroups so others can benefit from it
Feedback on answers is always appreciated!
Using Excel 2002 & 2003

"GolfGal" wrote in message
...
I download a .csv sheet daily, open & save as excel, and link to access.
However, access returns some #Num errors. I need to convert several of

the
columns to text, from what I read by adding apostrophe. Is there a macro
that I can run on certain columns that will add an apostrophe in front of
all? There are 7000 lines, so doing it manually is not possible.

Thanks



  #3   Report Post  
GolfGal
 
Posts: n/a
Default

THANK YOU very much! That worked great!

"Paul B" wrote:

Golf, here is one way

Sub add_apostrophe()
'will add an ' in front of whats in the used range in column A
Set rng = Intersect(Range("A:A"), ActiveSheet.UsedRange)
For Each c In rng
c.Value = "'" & c
Next
End Sub


--
Paul B
Always backup your data before trying something new
Please post any response to the newsgroups so others can benefit from it
Feedback on answers is always appreciated!
Using Excel 2002 & 2003

"GolfGal" wrote in message
...
I download a .csv sheet daily, open & save as excel, and link to access.
However, access returns some #Num errors. I need to convert several of

the
columns to text, from what I read by adding apostrophe. Is there a macro
that I can run on certain columns that will add an apostrophe in front of
all? There are 7000 lines, so doing it manually is not possible.

Thanks




Reply
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
Adding info in the row at the bottom using macro? Carrie Excel Discussion (Misc queries) 1 April 14th 05 04:18 PM
Adding an apostrophe Jeff Excel Discussion (Misc queries) 2 March 9th 05 04:02 PM
Playing a macro from another workbook Jim Excel Discussion (Misc queries) 1 February 23rd 05 10:12 PM
Date macro Hiking Excel Discussion (Misc queries) 9 February 3rd 05 12:40 AM
macro - adding rows to a column that is summed HGood Excel Discussion (Misc queries) 2 December 1st 04 03:28 PM


All times are GMT +1. The time now is 06:08 AM.

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"