Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 116
Default Is it possible to change and entire worksheet to text?

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

--
Message posted via http://www.officekb.com

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 421
Default Is it possible to change and entire worksheet to text?

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



"Carrie_Loos via OfficeKB.com" <u34134@uwe wrote in message
news:848d4b35cfad2@uwe...
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

--
Message posted via http://www.officekb.com


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 116
Default Is it possible to change and entire worksheet to text?

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

Norman Jones wrote:
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


--
Message posted via http://www.officekb.com

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,986
Default Is it possible to change and entire worksheet to text?

I have never tried it, but it seems like Cells.Value = CStr(Cells.Value)
should work.

"Carrie_Loos via OfficeKB.com" wrote:

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

Norman Jones wrote:
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


--
Message posted via http://www.officekb.com


  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 116
Default Is it possible to change and entire worksheet to text?

Hmmmmmm - That sounds interesting, I'll give it a try and let you know.

JLGWhiz wrote:
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


--
Message posted via http://www.officekb.com



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,441
Default Is it possible to change and entire worksheet to text?

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



"Carrie_Loos via OfficeKB.com" <u34134@uwe wrote in message
news:848e1685f696f@uwe...
Hmmmmmm - That sounds interesting, I'll give it a try and let you know.

JLGWhiz wrote:
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


--
Message posted via http://www.officekb.com



  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 116
Default Is it possible to change and entire worksheet to text?

Worked like a charm - Thx you guys just saved me many many painful hours!

Carrie

Bernie Deitrick wrote:
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


--
Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.a...mming/200805/1

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
How do I change the font to all caps for the entire worksheet? lasouthbeech Excel Worksheet Functions 1 July 13th 07 04:02 PM
How to change #DIV/0! result for an entire worksheet ? LG Excel Discussion (Misc queries) 4 May 26th 06 07:45 PM
How can I use one formula to change case on an entire worksheet? pow835 Excel Worksheet Functions 2 April 4th 06 09:04 PM
How do change entire worksheet to uppercase letters and lock it aeromutt Excel Worksheet Functions 2 April 1st 06 05:04 PM
How do I change uppercase to proper case in entire worksheet? Karen Excel Worksheet Functions 7 October 21st 05 12:31 PM


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

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

About Us

"It's about Microsoft Excel"