Jump to content
Macro Express Forums

Splitting an Excel row


Recommended Posts

I'm currently copying umpteen cells from a row in an Excel sheet putting each cell's data into variables. It's painfully slow so I'm trying to speed things up by copying the whole row into a text variable and then copying each "cell's value" of that variable into separate variables. Each "cells value" is separated by a CR/LF so I could, possibly, find the position of each CR/LF and copy that bit of the original variable to the new variable but how do I find the position of the CR/LF? I can't type CR/LF in "get position of text" dialogue. Maybe I could change CR/LF into ^ which never occurs in my data and use that to separate each cell but can't figure a way to do that or maybe there's an even better way.


Any help will be much appreciated - I've struggled for far too long.

Link to comment
Share on other sites

The ASCII (numeric) value for a CR is 13. The ASCII value for a LF is 10. This snippet will allow you to search for the position of CRLF in a string:

Variable Set %T13% to ASCII Char of 13
Variable Set %T10% to ASCII Char of 10
Variable Set Integer %N1% from Position of Text in Variable %T1%

Put '%T13%%T10% in the 'Search Text:' field of the 'Variable Set Integer from position of Text' command

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...