LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default ActiveCell.Value

Have you ever typed
1234_____
( _ = spacebar)
into a cell.

Excel is very forgiving. It'll let you do it, but fix it to be just 1234 (a
real number).

Same thing happens when you plop anything into a cell formatted as General
(non-text).

You could use what JLGWhiz suggested:

with activesheet
.range("a1").numberformat = "@" 'text
.range("A1").value = Mid(stringy, 4, 4)
End With

Or just like you use apostrophes when you're typing something into the cell:

activesheet.range("a1").value = "'" & Mid(stringy, 4, 4)

tmarsh7407 wrote:

I am assigning a two character string to a variable as follows (Stringy is
the variable I read each record form before breaking it into pieces):

ThisActy = Mid(Stringy, 4, 4)

The record I am reading from has "00 " (two zeros and two blanks) starting
at position 4. I then try to insert it into a cell in my spreadsheet as
follows:

ActiveCell.Value = ThisActy

However when I look at the cell I see a 0 (number, not text) in that cell.
I want it to stay in text form in the spreadsheet. What am I doing wrong?


--

Dave Peterson
 
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
If activecell.column = variable then activecell,offset (0,1) Battykoda via OfficeKB.com Excel Discussion (Misc queries) 1 October 2nd 07 08:05 PM
How to Revert to ActiveCell.Formula = format from ActiveCell.FormulaR1C1 = format Karthik Bhat - Bangalore[_2_] Excel Programming 1 May 9th 07 02:37 PM
ActiveCell [email protected] Excel Programming 2 August 9th 06 01:42 PM
if activecell is value רוזנט Excel Programming 4 July 11th 06 08:19 PM
Activecell value Shamsul Islam Excel Programming 5 April 30th 04 10:10 PM


All times are GMT +1. The time now is 01:49 PM.

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"