Text To Columns Macro

Sep 12, 2007

First of all i have to mention that i'm not a coder guy so excuse me if i'm no good in explaining the problem.

What i'm trying is to convert texts into columns. I constantly have an email containing short codes about my business and each code has a special meaning. So i need to convert these codes and lookup in my database. Here is an example of the source file in email.

V MFACTBEL 04-TLV * FH 42T B * USAFEP * FH42T440
V * MEDHCM EPAH342 EUDRPA1 * UDFSUB * EU5SCR
V FROCALC * TYPE-FH * V2514 * ULIVING * SOUNDPLU
V * AIRFLPAC * EC-REG * L405A71 * R690A71 * LNGTUR
V * MIRCOMF * CBL2-BA3 * 1DAYEC * TUR-MSP LFUEL
V RFUEL * WL-ST * UAXLE * TEXTILE * TTRCON77
V * ESH-LEFT * UDFP * 4*2 * TRACTOR CONC-BAS............

View 9 Replies


ADVERTISEMENT

Text To Columns :: Macro To Split Text

Jun 17, 2008

I am trying to write a micro code to split text which is copied into cell A1 into columns. I can do this fine by going to "data" the "text to Columns" and selecting the places i want to split the text (this is the same for every piece of data i copy in).

The macro works perfectly every time. the problem is that the spreadsheet is shared and i want to protect certain cells on the sheet, when i protect the sheet the recorded macro does not work as the "data", "text to columns" is not available in a protected workbook.

I was just wondering if someone could help me, so i can run a macro to split the text which also allows me to protect cells. In the "text to column" option the "fixed width" (column breaks) i choose are: 4, 25, 34 and 43.

View 11 Replies View Related

Text-to-Columns Macro

Jan 5, 2010

I am using the TexttoColumns macro to split cell contents into two columns. It works well except for one condition where the data it is parsing has a trailing zero. Excel drops the zero but I need it in the output.

Example Sun Management Center Agent: 4.0

Result
Column A Sun Management Center Agent
Column B 4

View 9 Replies View Related

Macro To Compare The Columns Text

Apr 1, 2009

macro to compare 4 columns of text (first and last names) then add a checkmark in separate columns if they match and don't match?
For example I have this kind of data to compare and the results required:

Sheet 1
Last Name First Name
Smith Mike
Johnson Bruce
Hendrick Fred
Shaffer Kerry

Sheet 2
Last Name First Name Match No Match
Klee Pierre X
Verge Kerry X
Smith Mike X
Wright David X
Hendrick Fred X

I need the macro to mark an X in the Match column if the first and last names match only and if they do not match exactly a X in the No Match column.

View 3 Replies View Related

Text To Columns Not Working In Macro

Nov 25, 2011

I've got a report that has a period date in it and its in the format "ARP-12", which is not set as a date. If I highlight the column and click Text to Columns it puts it in a date format which I can use.

I recorded myself doing this to insert into a marco but the date format is not correct. When I do it manually ARP-12 comes out as 01/04/2012 which is what I need but when i run the code i recorded it comes out as 12/04/2011.

I've pasted the code I've got below:

Columns("F:F").Select
Selection.TextToColumns Destination:=Range("F:F"), DataType:=xlDelimited, _
TextQualifier:=xlDoubleQuote, ConsecutiveDelimiter:=False, Tab:=True, _
Semicolon:=False, Comma:=True, Space:=False, Other:=False, FieldInfo _
:=Array(1, 1), TrailingMinusNumbers:=True
Range("A1").Select

View 7 Replies View Related

Macro For Text To Columns Function

Mar 31, 2013

Macro for text to columns function (if this is the best way to go).

Our work report exports customer subscriptions which we call "role name". Our customers subscriptions have a valid and start date, but our customers also can purchase multiple subscriptions and we need to separate this data in order to report by subscription.

Our export has an * after each subscription, the date is in square brackets and each subscription is separated by a semi column.

So for arguments sake, let's say we have the following subscriptions:

subscription a
subscription B
subscription C
subscription D

if one customer has purchased four subscriptions on various dates, their exports may look like this:

Subscription A* [01/02/2012 12:00:00 AM]* [01/02/2013 12:00:00AM]; Subscription B* [01/03/2012 12:00:00 AM]* [01/03/2013 12:00:00AM]; Subscription C* [01/04/2012 12:00:00 AM]* [01/04/2013 12:00:00AM]; Subscription D* [01/05/2012 12:00:00 AM]* [01/05/2013 12:00:00AM]

I then use a text to columns function to separate by the * and the;
I then am left with a column for the role, one for the start date and one for the expiry date.

The roles are in alphabetical order, but sometimes some manual sorting needs to be done to delete the roles I don’t need and keep the ones I do. For example someone could have subscribed to subscription B and not in A that means that the first column may not have all the roles I need, it may be in the second or third column depending on what other subscriptions they have.

So not sure if text to column is even the best way to go?

View 6 Replies View Related

Text To Columns Macro..ignoring Warning Box

Dec 9, 2008

I have this macro that does text-to-columns based on delimiting with spaces.
It seems to work fine but the first time I use it when I open my spreadsheet it comes up with "Do you want to replace the contents of the destination cells?".The answer to this is always yes, is there a little bit of code I can poke into this macro to ignore this warning?

View 3 Replies View Related

Text To Columns Macro With Blank Cells

Jan 3, 2008

I'm using the the Texttocolumns method in a Macro, and when it runs across a cell without any data I get "Run time error '1004' No data was selected to parse". How would I get passed this? I would like it to just remain a blank range without the error. Here's the code I'm using:

Range("F38").Select
Selection.TextToColumns Destination:=Range("F38"), DataType:=xlFixedWidth, _
FieldInfo:= Array(Array(0, 1), Array(5, 1), Array(13, 1), Array(21, 1), Array(25, 1)), _
TrailingMinusNumbers:=True

View 2 Replies View Related

VBA Macro To Loop Text To Columns Through All Rows Of Data?

Apr 17, 2014

I am trying to get a macro to run in excel that takes a simple text to columns command in one line of data and runs the command on a loop through however many rows of data there happen to be.

I've attached two screenshots - one with what I've got now (Before.jpg) and what I'd like to have after the macro runs (After.jpg). The code below is what I used to get the first text to column breakout, which I can hopefully run on a loop to breakout anything in the DEPT column that contains a "/". It can ignore the rows that only have one department to begin with.

Selection.TextToColumns Destination:=Range("K2"), DataType:=xlDelimited, _
TextQualifier:=xlDoubleQuote, ConsecutiveDelimiter:=False, Tab:=False, _
Semicolon:=False, Comma:=False, Space:=False, Other:=True, OtherChar _
:="/", FieldInfo:=Array(Array(1, 1), Array(2, 1)), TrailingMinusNumbers:=True

Eventually I'll want to create another macro that transposes the breakout text back into the DEPT column and populates it with the corresponding data, but I figure I'll take things one step at a time.

Attached Images
Before.jpg‎
ter.jpg‎

View 10 Replies View Related

Macro To Select Columns Specified In A Cell Using Text String

Jan 18, 2014

I have a cell in workbook X on Sheet1 (cell AB3) that states which columns should be exported from workbook X on Sheet3 to a new workbook. The value of cell AB3 on Sheet1 changes based on what a user selects in some check boxes on Sheet1. I would like my macro to read the value of cell AB3 and interpret it is a range reference of which columns to copy from Sheet3 into a new workbook. The problem I'm having is knowing what line(s) of code I would use in VB to read cell AB3 as a range and what kind of referencing rules I need cell AB3 to contain. Right now this is what the cell looks like to the user:

Code: Sheet3'(A:A,B:B,E:E,F:F).Select

For cell AB3 to look this way I'm just using some hard coded text, such as the sheet number and .Select, plus some concatenated values in between. Perhaps this text string needs to be modified, but I'm also wondering what I would use in my macro to reference the cell and read it as reference to which columns to select in Sheet3.

View 7 Replies View Related

Text To Columns Macro (to Avoid Out Of Memory Error)

Jul 5, 2009

I am trying to convert cells (all in column D) which are separated by "~" into columns. Unfortunately, running the text to columns command on several rows at a time can cause Excel to panic with an out of memory error (error #7 etc.).

The file is ~100mb and contains 500k-700k rows (I have 4GB of RAM so I know this is more a limit of Excel's 2GB RAM constraint).

Can you please help me write a macro to text to column convert each cell in column D?

I tried a macro which started with a for loop, and called the function for each cell individually, but even this led to an out of memory exception after 156,000 rows (although the same macro worked fine on a similar sheet with 700,000 rows).

Are there any other ways of clearing the Excel buffer/temporary space during the function calls to avoid causing Excel to crash?

View 9 Replies View Related

Text To Columns Macro For Irregular Spacing Of Data

Mar 1, 2010

i have written a macro to parse data in to four columns using the text to columns fixed width option, but unfortunately the data i get changes its spacing and configuration every day, meaning that the fixedwidth columns dont separate the data correctly. below is how it looks some of the time.

46632hac5 Jpmcc 2007-ld12 a5 19,340,005 315
0738qac5 bscms 2007-pw17 a5 23,142,005 265
61746wcz5 msdwc 2000-prin a5 3,600,005 305
32108hp75 bacm 2007-2 a5 2,000,005 465
46630edf5 lbubs 2006-c1 a5 1,000,005 285...............

View 9 Replies View Related

VBA Macro To Process Data After Paste With Text To Columns..

Mar 24, 2009

My problem is that data from previous applications are "bleeding" into new applications while running my macro.

I am utilizing the macro below to paste an application and then to convert the application to upper case in addition to some additional formating changes. After performing the macro I save the newly created document to a different folder. With new applications I repeat the above steps.

I tried to incorporate the clearing of the clipboard in my macro using: Edit=>office clipboard=>clear all. The keys strokes during the " record macro" process do not seem to record in the macro.

I am using Excel 2003, SP2

Sub Process_Application()
'
' Process_Application Macro
' Macro recorded 3/23/2009
'

'
ActiveSheet.Paste
Columns("A:A").Select

View 9 Replies View Related

Text To Columns Macro (fixed Width) With Predefined Format On Result

May 18, 2009

I need to fixed width-text to column macro and found a reply in the forum.

However, when I apply the macro, the result of zeros in front of figures disappear since the format of value in splitted column doesn't predefined as text

e.g. sample text to split to column:
000122042009ABCDEFG00567

Required result:
0001|22042009|ABCDEFG|00567

when running below macro; result shows:
1|22042009|ABCDEFG|567
(Beginning zeros figures of the first and last column disappear)

Applied Macro:

View 3 Replies View Related

Macro To Unhide Columns - Call A Macro Then Revert Columns To Previous State

Jul 17, 2014

I have on sheet1 a number (72 at the moment) of Form CheckBoxes.

In simple terms: I would like a macro to look at each CheckBox and remember its state (Checked or Unchecked)

Then, go through and Check All checkboxes

Call MyMacro

Once MyMacro is complete (Filtering & Printing)

Revert the checkboxes to their original state.

The purpose of the checkboxes:

When Checked column on sheet2 is UnHidden
When UnChecked column on sheet2 is Hidden

Or, UnHide All columns on sheet2, run MyMacro, then "re-hide" the columns that were previously hidden.

View 11 Replies View Related

Text File Import With Text To Columns Splitting Same Text Differently

Nov 21, 2007

I have a macro which imports data from a mainframe dump text file and performs 'Text to Columns' on the imported data so that formula in the spreadsheet can act on the data. The code works perfectly well when I use it, but if a different user logs on and performs exactly the same mainframe dump and import macro the Text to Columns action splits the raw data in a different way and the result is that the split renders the formulae useless.

I've experimented a little and for some reason it appears that the 'Field Info' parameters which are produced when the Text to Columns function is recorded in a macro differ between users even though the raw data is exactly the same.

FieldInfo:= _
Array(Array(0, 1), Array(18, 1), Array(35, 1), Array(56, 1), Array(70, 1), Array(88, 1), _
Array(102, 1))

View 6 Replies View Related

Excel 2013 :: Set One Columns Text To Color Based On Another Columns Results?

Apr 9, 2014

how to set one entire columns text to two different colors based on another columns values. So for example I have column A and B. Column A has two values called Internal and External. Column B is a title table so the entire column is just titles. We'll say it goes for 20 rows if you need a row count. What I am looking to do change the text in Column B to Red for External and Blue for Internal. I tried the conditional formatting and I just can't seem to find the right option.

I'm using Win 8.1, Office 2013.

View 4 Replies View Related

Text To Columns/time Formatting Split Them Into Columns

Jan 5, 2010

I've got some time values in an Excel Sheet in the format hh:mm:ss. I need to split them into columns (including the colon) like below:

hh: | mm: | ss

I can do this manually using text to columns but when I use text to columns in my macro, it automatically changes the time format to h:mm:ss PM

View 2 Replies View Related

Compare Text Strings In Two Columns And Return Text From Adjacent Cell

Feb 28, 2013

how to Chk the text string in particular cell, compare it with a super set column and get the full from of the text string from another corresponsing column and the output will be corresponsing full form of the chked text string?

View 6 Replies View Related

How To Split Text From Text String Into Separate Columns - No Delimiters

Apr 8, 2014

I have the cell data as below

How would I split into a new column the first part which is a date into a new column, then the country and the remainder into separate columns?

I still want the original data as I need to check that the splits worked well?

16.5.90 CH 1671/90-4
18.10.1991 CH 3056/91-1
24.07.92 ch 2341/92-2
30.7.92 ch 2395/92-3
18.11.92 Us 3533/92-5
26.5.93PCT 1577/93-0
9.8.93 CH 2363/93-8
17.8.93 CH 2445/93-0
25.1.94ch209/94-6;8.12.94ch3714/94-1
25.1.94 ch 209/94-6 ; 8.12.94 ch 3714/94-1
8.4.94 ch 1047/94-0
22.4.94 ch 1255/94-7
18.11.1992 CH 3533/92-5
18.11.1992CH 3533/92-5

View 2 Replies View Related

Extracting Strings Of Text From Columns Of Data(text)

Apr 23, 2007

What I have is a column of data(text) which contains amongst all the text three strings of text in ever cell in the column which I require copying into three adjoining cells

The data I require is :-

(a) The persons name which is always after the word ‘Requester’ e.g. Requester Steve Robinson

(b) Their office location which is directly after the persons name and is in brackets e.g. (Newcastle User)

(c) The Approving persons name which is preceded by ‘Approved by’ e.g. Approved by Christine Hunting

See examples 1 & 2 below

Example 1

CR0/CRZ3651 Requestor Steve Robinson (Newcastle User) Tel: 01234 798157 Approved by Christine Hunting

Please install and configure 2 Ultra 2s (typhoon and lancaster) for use as ARTE workstations. These workstations require Solaris 2.5.1 plus the same patches as before

Example 2

CR0/CRZ3118 Requestor Doug Cunningham (Newport User) Tel: 0114 9881480 Approved by John Smithers

Please provide support to set up Cisco 2691 Router and PIX-506E Firewall to enable external connection of a remote terminal for project work.

As you will appreciate the text in the cells is of non standard lenght and the three pieces of information can be located virtually any where in the text

View 9 Replies View Related

To Populate Three Columns With Text Based On Text Of Another Column

Dec 16, 2009

I am having a trouble in Excel sheet.My column A has a drop down list with text- possible, not possible, not required.Based on the text, i need to populate texts in columns B, C and D.

For example

Column A drop down selected is "possible"
then B coulmn should automatically populate "1-3"
C should populate with "3-5"
D should be "5-7"

I am using MS excel 2007.

View 9 Replies View Related

Use Text To Columns Feature To Be Text To Rows?

Jan 13, 2003

I have a cell that has a comma separated value that is 354 fields long. As such, if I use the Text To Columns feature to split the data at each column, I lose several columns (because excel cannot have that many columns).

How can I break the data at the comma, but have it list in rows instead?

View 9 Replies View Related

Text To Column - Want Columns Formated To Text

Dec 31, 2008

In Column A1:A10 I have a really long series of alpha numberic digits in each cell.

I use this macro with text to column to split them up for me into different columns.

The problem I have is that after they go through this conversion all of the fractions in columns L are turned into dates....

View 9 Replies View Related

Macro To Compare Columns A & B And Dispaly Any Duplicates In Columns C & D

Feb 21, 2009

what I'm after is a macro to check the contents of Column 'A' against column 'B' and display any duplicates in Columns 'C' & 'D'.

N.B. The headings of Columns C & D are :-

C = Value Found in Column A

D = Value Found in Column B

Any duplicate entries logged in columns C & D should be listed in C2,C3,C4....C20 and D2,D3,D4......D20 etc (in effect creating two new lists)

View 5 Replies View Related

Macro Needed To Include Particular Columns Out Of So Many Columns In A Sheet

Apr 23, 2014

I have file with so many columns and i want to keep only columns i want.

Data
genredyellowgreenwhiteblue
1aaggttccbb
2aaggttccbb
3aaggttccbb
4aaggttccbb
5aaggttccbb

expected
genredwhite
1aacc
2aacc
3aacc
4aacc
5aacc

for example here i want to keep only gen, red and white columns only out of columns what i have in my data. I have so many columns in my original data but here i given just small example. How to proceed with macro or any other way because removing manually taking long time for me.

View 6 Replies View Related

Join Text Of 2 Columns Into 2 More Columns

Jan 11, 2008

how to add two columns of single words together, so that all possible word combinations are seen. For example:

Column1:

Horse
Pig
Dog
Sheep

Column2:

Run
Walk
Sit
Roll

So... I'd like Column3 to look like this:..........

The issue is I have about 100 words all together so there will be a lot of results! Is there a way I can enter a formula to do this?

View 2 Replies View Related

Text In One Column But NOT By Text To Columns

Dec 6, 2006

I've had this issue a couple of times and can't work out an easy way to deal with it.

I have text data in one column.

Name
Add1
Add2
City
Pcode
Manager
Name
Add1
Add2
City
Pcode
Manager
etc

How do I extract Row 1 into Column 1, R2-C2,... R7-C1, R8-C2?

To make it more tricky what if there isn't a consistent amount of data, ie sometimes I'll have Manager name (6 rows of data) and sometimes I won't (5 rows of data) and then the next collection of data will have it again.

Does this make sense?

View 9 Replies View Related

Excel 2010 :: Macro For Replacing Text In HTM Document - Text To Change Different Every Time

Mar 18, 2014

I am my excel worksheet (excel 2010) I have one cell that changes every day (number). I want this number to open my htm document and replace the same number in a string in the htm and save/close this.

An example:
My htm document is located at C:/ and named XX.htm

The number I want from excel is in cell A1 in sheet1, and the worksheet is located in D:/ named yy.xlsx

And the text(number) I want to replace is in the following string in the htm document, in this string it is 72, next day it can be 30:

src="Bilder/72.png"

View 8 Replies View Related

Macro To Automatically Convert PrtScr Image Based Text To Real Text In Cell

Mar 22, 2014

Programming Excel VBA Macro to do OCR (text recognition) from a prt scr screen capture image and input the text into cells. Currently my Excel file has a push-button, and upon clicking on it the macro pastes into Excel the current clipboard image I have created by pressing prt scr while in another program. The macro then crops the image to the region with the applicable text. I have to then manually type the text I see in image format into the appropriate cells.

the VBA coding to automate this? I'd like it to use the clipboard image and run it through OneNote OCR, after which the applicable text values are automatically entered into the cells. Ideally the code will first crop to the region with the desired text before it does OCR. If this is not feasible, it will need to incorporate a method (keyword search?) to hone in on the desired text after the entire prt scr image has been OCRed.

View 8 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved