nmanager Posted March 6, 2008 Report Share Posted March 6, 2008 When I paste from the clipboard into a cell, it pastes text up to a variable then drops down to the next cell and pastes the rest of the text. In the example below: T35 = Jun T3 = %35% Rev = Jun Rev "Jun" is printed in one cell (A1) and "REV" prints in the cell below it (A2). It is all supposed to print in one cell (A1) <TVAR2:03:01:%T35% Rev><TMVAR2:16:03:00:000:000:><CLIPP> Another clue - when this is run as a standalone macro it puts all in one cell. When it is part of the macro I am working on, it puts it in two cells. The same code with two different results! Jun Rev vs. Jun Rev Win 2000/Office 2000 Quote Link to comment Share on other sites More sharing options...
Cory Posted March 6, 2008 Report Share Posted March 6, 2008 I'm guessing that the first bit of text is being copied from a cell. If you bring that into a text var it puts a CRLF at the end. That's a Carriage Return and a Line Feed Which is used to signify the end of a line. When combined as you have done it would cause Excel to think that there are two cells of data in two rows and thats how it pastes it. If this is the case after you copy your first cell and convert it to a string var try issuing the trim command on it. This will trim any nonprinting characters off the var. <TVAR2:01:03:><TMVAR2:01:01:00:000:000:> BTW this is actually a handy feature. When you copy ranges of cells in this way they become tab separated values. Like a CSV but with tabs. You can use this to process the blocks like with the ASCII File Process command. It's very handy! Oh, and this is a easy quick way yo get data back into Excel. Seperate your columns with tabs and rows with CRLF and you can paste it all in as one big block in one operation! Quote Link to comment Share on other sites More sharing options...
nmanager Posted March 6, 2008 Author Report Share Posted March 6, 2008 Thanks Cory, the "extra" line feed was the problem. It is printing on one line now. It is a good feature to know about and will come in handy on Excel. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.