Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 169
Default Convert column to text

Hello,
I want to convert a column with "SSN" title in text but I don't know where
the column is located. The programation below gives me the first column wich
contains SSN title. Does anyone know how to find an exact match of the SSN
title ?
Thanks!
} Set rng = wks.Rows(1).Find(What:="SSN")
} If Not rng Is Nothing Then rng.EntireColumn.TextToColumns Cells(1,
rng.Column)
--
Alex St-Pierre
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 486
Default Convert column to text

Find takes a number of arguments. Add this argument and it will require an
exact match...

Set rng = wks.Rows(1).Find(What:="SSN", LookAt:=xlWhole)

--
HTH...

Jim Thomlinson


"Alex St-Pierre" wrote:

Hello,
I want to convert a column with "SSN" title in text but I don't know where
the column is located. The programation below gives me the first column wich
contains SSN title. Does anyone know how to find an exact match of the SSN
title ?
Thanks!
} Set rng = wks.Rows(1).Find(What:="SSN")
} If Not rng Is Nothing Then rng.EntireColumn.TextToColumns Cells(1,
rng.Column)
--
Alex St-Pierre

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Convert column to text

Record a macro when you do the .find manually. You'll see one of the options is
to look at the whole cell.

LookAt:=xlWhole

I think you'll find it better to specify all the parms that you can. Excel/VBA
will remember the last settings used--no matter if the user did it or your code
did it.

with wks.rows(1)
set rng = .Find(What:="SSN", _
After:=.cells(.cells.count), _
LookIn:=xlValues, _
LookAt:=xlWhole, _
SearchOrder:=xlByRows, _
SearchDirection:=xlNext, _
MatchCase:=True)


I specified match case and whole cell.


Alex St-Pierre wrote:

Hello,
I want to convert a column with "SSN" title in text but I don't know where
the column is located. The programation below gives me the first column wich
contains SSN title. Does anyone know how to find an exact match of the SSN
title ?
Thanks!
} Set rng = wks.Rows(1).Find(What:="SSN")
} If Not rng Is Nothing Then rng.EntireColumn.TextToColumns Cells(1,
rng.Column)
--
Alex St-Pierre


--

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
convert column from numbers to text Tim[_7_] Excel Discussion (Misc queries) 2 September 12th 07 04:56 AM
Convert text to column JN Excel Worksheet Functions 4 April 14th 05 05:49 PM
convert column data into text Charlie Excel Discussion (Misc queries) 1 January 30th 05 12:47 AM
convert a column of text to proper Harvey New Users to Excel 4 December 17th 04 02:25 PM
Convert text to column shital Excel Programming 2 September 9th 04 12:18 PM


All times are GMT +1. The time now is 02:59 AM.

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"