Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
newbie: force paste as text?
Using XL2003...
I have a source worksheet that has numbers stored as text, with leading zeros. I load that worksheet into an array for faster processing I use a msgbox to confirm that I still have my full string values, including leading zeros but for everything I've tried, when I paste those values back into other cells, they show up as numeric and I lose my leading zeros. The overall length of the string, and the number of leading zeros can vary. Sub pasteavalue() Dim rets As String rets = (Sheet4.Range("C6712").Value) MsgBox rets ' shows 05315 Sheet4.Range("G6712").Value= rets ' pastes as numeric 5315 End Sub I'm sure this must be simple, but a google search and help file search hasn't turned up any solutions (maybe I'm missing a key search term or something). The problem is that I then use the pasted value to pull data from another file that includes the leading zeros, and because of this situation, it doesn't find any matches. Many thanks for any assistance! Keith -- The enclosed questions or comments are entirely mine and don't represent the thoughts, views, or policy of my employer. Any errors or omissions are my own. |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Force text to overlap | Setting up and Configuration of Excel | |||
excel save as csv - force text qualifier on every text field | Excel Discussion (Misc queries) | |||
newbie - how to paste into an occupied cell | New Users to Excel | |||
How to force a paste of values only? | Excel Programming | |||
Copy cells and paste to an address given in another cell (VBA Newbie) | Excel Programming |