Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
dan dan is offline
external usenet poster
 
Posts: 866
Default Concatenate values

Trying to concatenate data that is imported in a file but having a problem.

..Offset(0, 2).Value = Right("0000000" & myID & "h", 4)

Data Want Get
2C0 2C0h 2C0h
402 402h 402h
0 000h 0 h - two spaces between 0 and h
14 0014h 14 h - one space b/w 14 and h
2 0002h 2 h - two spaces between 2 and h

Second problem is some of the data that is imported is "00" and I want to
keep this
format but when imported the "00" becomes "0".

Any suggestions?

Thanks

  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
FxM FxM is offline
external usenet poster
 
Posts: 9
Default Concatenate values

Dan a écrit :
Trying to concatenate data that is imported in a file but having a problem.

..Offset(0, 2).Value = Right("0000000" & myID & "h", 4)

Data Want Get
2C0 2C0h 2C0h
402 402h 402h
0 000h 0 h - two spaces between 0 and h
14 0014h 14 h - one space b/w 14 and h
2 0002h 2 h - two spaces between 2 and h

Second problem is some of the data that is imported is "00" and I want to
keep this
format but when imported the "00" becomes "0".

Any suggestions?

Thanks



Hi Dan,

Looks like your 0 is 0 followed by two spaces. To remove (not tested),
you can try :
..Offset(0, 2).Value = Right("0000000" & trim(myID) & "h", 4)

If ever spaces were not chr(32) but chr(160) [importing...], you'll have
to replace this(these) character(s) by nothing. Could lead to :
myID = application.substitute(myID,chr(160),"")
..Offset(0, 2).Value = Right("0000000" & trim(myID) & "h", 4)


Concerning your "00" import, probably "00" is NOT "00" (text) but 00
(numeric). Excel converts as zero so 0.
During import options, set the columns to text and the problem will
disappear.

Finally you probably realized that above is NOT worksheetfunction.
Please give preference to programming group where you also posted.

HTH
FxM
  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
dan dan is offline
external usenet poster
 
Posts: 866
Default Concatenate values

"FxM" wrote:

Dan a écrit :
Trying to concatenate data that is imported in a file but having a problem.

..Offset(0, 2).Value = Right("0000000" & myID & "h", 4)

Data Want Get
2C0 2C0h 2C0h
402 402h 402h
0 000h 0 h - two spaces between 0 and h
14 0014h 14 h - one space b/w 14 and h
2 0002h 2 h - two spaces between 2 and h

Second problem is some of the data that is imported is "00" and I want to
keep this
format but when imported the "00" becomes "0".

Any suggestions?

Thanks



Hi Dan,

Looks like your 0 is 0 followed by two spaces. To remove (not tested),
you can try :
..Offset(0, 2).Value = Right("0000000" & trim(myID) & "h", 4)

If ever spaces were not chr(32) but chr(160) [importing...], you'll have
to replace this(these) character(s) by nothing. Could lead to :
myID = application.substitute(myID,chr(160),"")
..Offset(0, 2).Value = Right("0000000" & trim(myID) & "h", 4)


Concerning your "00" import, probably "00" is NOT "00" (text) but 00
(numeric). Excel converts as zero so 0.
During import options, set the columns to text and the problem will
disappear.

Finally you probably realized that above is NOT worksheetfunction.
Please give preference to programming group where you also posted.

HTH
FxM


Thanks for the response. Did not see your response before I tried the TRIM
function which corrected the problem.

Will try setting the cell to text to maintain the "00" zero zero value.

Thanks


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
Keeping a cell value constant trhoughout a list of values borikua05 Excel Worksheet Functions 2 December 3rd 05 03:03 PM
Count Intervals of 2 Consecutive Values in same Row and Return Count across Row Sam via OfficeKB.com Excel Worksheet Functions 6 November 29th 05 03:27 PM
I Need a formula to evaluate a cell with + or - values Bob in Oklahoma Excel Worksheet Functions 6 October 31st 05 02:41 PM
#N/A Values : Returned by Formulas vs Entered Manually monir Charts and Charting in Excel 8 July 7th 05 01:16 AM
Leading Zeros in Numeric Values DBavirsha Excel Worksheet Functions 6 January 4th 05 05:21 PM


All times are GMT +1. The time now is 04:24 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"