Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Using "Equiv" excel fonction in vba
Hi,
My goal is to convert to a text a specific column which contain title "SSN". If the column "A" is SSN column, I could use: Columns("A:A").TextToColumns Destination:=Range("A1") works if the column "A" is SSN. Since, I don't know what is the column, I would like to say: 1- What is the column which contain "SSN" title on line 2 (like Application.Equiv("SSN",Range(A2:IV2),False) 2- Convert this column number in text (Example: convert column "4" to "D" 3- After that, I could use fonction Columns("D:D").TextToColumns Destination:=Range("D1") with D variable. If somebody have a simpler solution, plz, let me know :) Thank you, - Alex St-Pierre |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Using "Equiv" excel fonction in vba
Text to columns takes arguments and I don't know what they would be as I
don't know your data. That being said you should be able to fill that part in... Try this code... Sub ConvertToColumns() Dim rng As Range Dim wks As Worksheet Set wks = ActiveSheet Set rng = wks.Rows(2).Find(What:="SSN") If Not rng Is Nothing Then rng.EntireColumn.TextToColumns Cells(1, rng.Column), ???, ??? End If End Sub -- HTH... Jim Thomlinson "Alex St-Pierre" wrote: Hi, My goal is to convert to a text a specific column which contain title "SSN". If the column "A" is SSN column, I could use: Columns("A:A").TextToColumns Destination:=Range("A1") works if the column "A" is SSN. Since, I don't know what is the column, I would like to say: 1- What is the column which contain "SSN" title on line 2 (like Application.Equiv("SSN",Range(A2:IV2),False) 2- Convert this column number in text (Example: convert column "4" to "D" 3- After that, I could use fonction Columns("D:D").TextToColumns Destination:=Range("D1") with D variable. If somebody have a simpler solution, plz, let me know :) Thank you, - Alex St-Pierre |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Excel - Golf - how to display "-2" as "2 Under" or "4"as "+4" or "4 Over" in a calculation cell | Excel Discussion (Misc queries) | |||
change "true" and "false" to "availble" and "out of stock" | Excel Worksheet Functions | |||
Excel should have a "pretty print" fonction for formulas. | Excel Discussion (Misc queries) | |||
HELP on "left","right","find","len","substitute" functions | Excel Discussion (Misc queries) | |||
Count occurences of "1"/"0" (or"TRUE"/"FALSE") in a row w. conditions in the next | New Users to Excel |