Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 6
Default String to Variant incorrect conversion

I am using Harlan Grove's PULL function to grab data from other
spreadsheets, and it mostly works except that some strings that look
like dates get converted to numbers and therefore don't work with
VLOOKUP and the like. For example, "06-6107" gets changed to
1536728. It seems that this is happening in this bit of code:

For Each c In r
c.Value = xlapp.ExecuteExcel4Macro(b & c.Address(1, 1, xlR1C1))
Next c

The Value property is a Variant, so in the conversion the string is
interpreted as a date. Is there any way to force that to be converted
a Variant/String instead of Variant/Double?

Thanks,
Paul

  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 35,218
Default String to Variant incorrect conversion

Check your other post.

Paul wrote:

I am using Harlan Grove's PULL function to grab data from other
spreadsheets, and it mostly works except that some strings that look
like dates get converted to numbers and therefore don't work with
VLOOKUP and the like. For example, "06-6107" gets changed to
1536728. It seems that this is happening in this bit of code:

For Each c In r
c.Value = xlapp.ExecuteExcel4Macro(b & c.Address(1, 1, xlR1C1))
Next c

The Value property is a Variant, so in the conversion the string is
interpreted as a date. Is there any way to force that to be converted
a Variant/String instead of Variant/Double?

Thanks,
Paul


--

Dave Peterson
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 assign range to variant and use Mike H[_2_] Excel Discussion (Misc queries) 7 June 7th 07 01:40 AM
counting the number of instances of a string within another string Keith R Excel Worksheet Functions 3 March 5th 07 06:54 PM
How do I replace last numeric string from a alphanumeric string? Christy Excel Discussion (Misc queries) 3 August 11th 06 12:17 AM
Splitting a text string into string and number mcambrose Excel Discussion (Misc queries) 4 February 21st 06 03:47 PM
to search for a string and affect data if it finds the string? Shwaman Excel Worksheet Functions 1 January 11th 06 12:56 AM


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

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"