MrExcel Publishing
Your One Stop for Excel Tips & Solutions

Excell Macro


Posted by Tiffany on February 01, 2001 11:13 AM

Question....I have question about writing macro code in order to format excel sheet. I have excell sheet format like
"FirstName=A
LastName=B
State=TX
Address=306 AAAA
City=AA
FirstName=B
LastName=B
State=TX
Address=306 BB
City=BB"
I want to change it to be table sheet format such as:
Firstname| Lastname| State| Address| City|

Does anybody have any ideal how to write a macro or coding for this excel. Or may anybody help me to write macro for it.

Thanks for any reply
Tiffany


Posted by Faster on February 01, 2001 3:02 PM

Try to copy the data and paste special transpose.

Copy the data
Edit > Paste Special > Transpose

I hope this helps

Posted by Tiffany on February 01, 2001 4:16 PM

It's work. Thanks, however I have alots (more than 40)sheets like this, and I try to do some better ways

Tiffany


Posted by Shreenivas on February 02, 2001 6:27 AM

Using Visual Basic, how do I paste a table from Excel spreadsheet to a word file? I am able to copy from excel and paste in excel. But can not do so from excel to word.
Please help!

Posted by Tiffany on February 02, 2001 12:56 PM

Why don't try to save table from Excel (xls) spreadsheet to a word file (doc). Hope fully it work

Posted by Chance on February 02, 2001 4:25 PM

You have a couple of options. But you don't need VBA to do this unless you are trying to automate the process.

Start by selecting the range of cells you want to copy to Word. Click on Copy. Open the Word document where you want the Excel information to reside. IF you simply click on paste in Word ..the excel information will copy into Word as a table....the formulas will NOT hold but the results of the formulas will be present. IF you want the formulas to hold, you have the option to paste with Excel functionality or paste a link to the original workbook, thus when the original workbook is updated the information in word will also be updated. You use the Paste Special command to select either of these options. In the Paste Special options box ...choose Microsoft Excel Worksheet Object to incorporate Excel editing capability into your Word Document. Click on Paste Link Radial Button to link the Word document to the original Excel file.

Hope this helps ... if any of it is unclear let me know. Also, if you are trying to automate this process with a VBA program .... let me know and I'll try to help you.

Posted by Susanto Siman on August 24, 2001 11:42 AM

easy, use vb to sendkeys to block the table, for example from row 4 and column 3 to row 5 and column 8. Thus, send the keys to block from (4,3) to (5,8) then sendkeys to excel to copy the table and then paste it into word.
8)
cheers
I assumed that u know how to send keys.