Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / Programming / May 2008

Tip: Looking for answers? Try searching our database.

Is it possible to change and entire worksheet to text?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Carrie_Loos - 22 May 2008 23:23 GMT
I have these files that I am receiving in Excel that are not set up to be
database friendly. I am spending hours cutting and pasting to rearrange them
into a mode where I can import them into a little Access Database that I have.
The problem is they are full of serial numbers some with symbols and/or
letters some with not. The field in Access is text and so I want to convert
all the information in the Excel files to text rather than a mixture of
values and text. I have been using the =TEXT function but the way the
worksheets are it is just as cumbersome as all the cutting and pasting. I was
hoping for a little macro to just covert everything but in my searches I
cannot find a way. Does anybody know of one?

Thanks
Carrie
Norman Jones - 22 May 2008 23:55 GMT
Hi Carrie,

Addresing the second part of your post:

===========
want to convert
all the information in the Excel files to text rather than a mixture of
values and text. I have been using the =TEXT function but the way the
worksheets are it is just as cumbersome as all the cutting and pasting. I
was
hoping for a little macro to just covert everything but in my searches I
cannot find a way. Does anybody know of one?
===========

Try:

       Select all data
       Menu | Format | Number | Text

---
Regards.
Norman

>I have these files that I am receiving in Excel that are not set up to be
> database friendly. I am spending hours cutting and pasting to rearrange
[quoted text clipped - 13 lines]
> Thanks
> Carrie
Carrie_Loos - 23 May 2008 00:18 GMT
Thanks Norman -

However I didn't just want to format I needed to change the values to text.
But I think I have solved the issue by inserting a row of text first and then
uploading to Access then it will recognize the entire column as text.

Carie

>Hi Carrie,
>
[quoted text clipped - 24 lines]
>> Thanks
>> Carrie
JLGWhiz - 23 May 2008 00:45 GMT
I have never tried it, but it seems like  Cells.Value = CStr(Cells.Value)
should work.

> Thanks Norman -
>
[quoted text clipped - 32 lines]
> >> Thanks
> >> Carrie
Carrie_Loos - 23 May 2008 00:54 GMT
Hmmmmmm - That sounds interesting, I'll give it a try and let you know.

>I have never tried it, but it seems like  Cells.Value = CStr(Cells.Value)
>should work.
[quoted text clipped - 4 lines]
>> >> Thanks
>> >> Carrie
Bernie Deitrick - 23 May 2008 01:19 GMT
Select all the cells with values and run this macro

Sub ChangeAllToText()
Dim myC As Range
For Each myC In Selection
myC.Value = "'" & myC.Text
Next myC
End Sub

The line
Cells.Value = CStr(Cells.Value)
won't work because you will lose the formatting - .Text shows the formatted
value, and you need to loop through to put the ' in front of the values,
(especially date values) to keep them from converting back from text.

HTH,
Bernie
MS Excel MVP

> Hmmmmmm - That sounds interesting, I'll give it a try and let you know.
>
[quoted text clipped - 6 lines]
>>> >> Thanks
>>> >> Carrie
Carrie_Loos - 23 May 2008 01:37 GMT
Worked like a charm - Thx  you guys just saved me many many painful hours!

Carrie

>Select all the cells with values and run this macro
>
[quoted text clipped - 20 lines]
>>>> >> Thanks
>>>> >> Carrie
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.