Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3
Default vlookup format problem

How do I change data format so that vlookup will recognize that it is a match
for the desired value? I've tried copy, paste special, custom formatting,
etc. but when I select a particular cell, the value that appears on the
formula bar is still in the wrong format, even though the formats appear
correctly in the column.

The original data comes over as general "3.40111E+12", in the formula bar it
appreas as "34011120010001" and I want it to be "34-0111-2001-001".

  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 11,058
Default vlookup format problem

I suggest first transforming your data so it actually is hyphenated. Enter
this small macro:

Sub xformt()
Dim s As String
For Each r In Selection
v = r.Value
s = Left(v, 2) & "-" & Mid(v, 3, 4) & "-" & Mid(v, 7, 4) & "-" &
Right(v, 4)
r.Value = s
Next
End Sub

Select the cells you want to change and run the macro.
--
Gary''s Student - gsnu200731


"Patio" wrote:

How do I change data format so that vlookup will recognize that it is a match
for the desired value? I've tried copy, paste special, custom formatting,
etc. but when I select a particular cell, the value that appears on the
formula bar is still in the wrong format, even though the formats appear
correctly in the column.

The original data comes over as general "3.40111E+12", in the formula bar it
appreas as "34011120010001" and I want it to be "34-0111-2001-001".

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
VLOOKUP problem Ravenbear Excel Discussion (Misc queries) 3 July 24th 06 09:54 PM
VLookUp problem Louise Excel Worksheet Functions 2 May 22nd 06 04:27 PM
vlookup Problem marksuza Excel Discussion (Misc queries) 3 December 22nd 05 03:40 PM
VLookup Problem bwall Excel Discussion (Misc queries) 5 September 10th 05 12:15 AM
Vlookup Problem Dominique Feteau Excel Worksheet Functions 3 December 19th 04 06:36 AM


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