Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #4  
Old 10-14-2011, 10:10 AM
Catalin.B Catalin.B is offline Macro to Insert Text Into Cells Having Multiple Lines Windows Vista Macro to Insert Text Into Cells Having Multiple Lines Office 2010 32bit
Expert
 
Join Date: May 2011
Location: Iaşi, Romānia
Posts: 386
Catalin.B is on a distinguished road
Default

Try this code then... (you need to set a reference to the Microsoft Forms 2.0 Object Library... To add a reference to your VBA project, go to the Tools menu in the VBA editor and choose the References item. In the dialog that appears, scroll down the list until you find the appropriate library )
Code:
Sub paste()
Dim DataObj As New MSForms.DataObject
    Dim S, T As String
    DataObj.GetFromClipboard
    T = ActiveCell.Value
    
    S = DataObj.GetText
   
ActiveCell.Value = T & " " & S
End Sub
Reply With Quote
 



Similar Threads
Thread Thread Starter Forum Replies Last Post
How to Insert a Clear, Blank page without Lines and Numbers in a Pleading Document Dirigo Word 5 09-30-2011 08:08 AM
Macro to Insert Text Into Cells Having Multiple Lines Multiple VLOOKUP's checking multiple Cells OTPM Excel 11 05-23-2011 11:18 AM
Macro to Insert Text Into Cells Having Multiple Lines filling multiple cells whislt using Filter VinceO Excel 1 05-09-2011 06:38 AM
Macro to Insert Text Into Cells Having Multiple Lines How to organize and insert blank cells between a huge number of data? tareq Excel 12 09-29-2010 02:12 PM
Macro to Insert Text Into Cells Having Multiple Lines Horizontal lines won't insert into full margins set in a doc. rec Outlook 2 06-14-2010 09:47 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 04:41 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft