Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 51
Default Long shot? Copy rows but have XL2K insert a space between each row??

If I have this type of thing in a workbook:

Information in row A
Information in row B
Information in row C
Information in row D




Is there a way to have Excel add an extra line to what we copy to the
clipboard so that when we paste the data, we get this instead of the above?:

Information in row A

Information in row B

Information in row C

Information in row D


It feels like a longshot but so many times I've been surprised at what Excel
can do by what you've all shown me in this group, that I'm putting the
message out there anyway.

Thanks much! :oD


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 22,906
Default Long shot? Copy rows but have XL2K insert a space between each row??

Rows are the numbers down side of sheet.

Columns are the letters across top of sheet.

Assuming you mean rows....................

Sub InsertRows22()
Application.ScreenUpdating = False
Dim numRows As Integer
Dim r As Long
Range(Range("A1"), Range("A1").End(xlDown)).Copy _
Destination:=Sheets("Sheet2").Range("A1")

r = Cells(Rows.Count, "A").End(xlUp).Row
numRows = 1
For r = r To 1 Step -1
ActiveSheet.Rows(r + 1).Resize(numRows).Insert
Next r
Application.ScreenUpdating = True
End Sub


Gord Dibben MS Excel MVP

On Thu, 14 Jun 2007 14:26:16 -0400, "StargateFanFromWork"
wrote:

If I have this type of thing in a workbook:

Information in row A
Information in row B
Information in row C
Information in row D




Is there a way to have Excel add an extra line to what we copy to the
clipboard so that when we paste the data, we get this instead of the above?:

Information in row A

Information in row B

Information in row C

Information in row D


It feels like a longshot but so many times I've been surprised at what Excel
can do by what you've all shown me in this group, that I'm putting the
message out there anyway.

Thanks much! :oD


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,391
Default Long shot? Copy rows but have XL2K insert a space between each row??

If the paste is outside of Excel, then use the DataObject; requires
reference to Forms2. Something like:

Private Sub CommandButton2_Click()
Dim DatObj As DataObject

Const FORMAT_TEXT As Long = 1

Set DatObj = New DataObject

Selection.Copy

With DatObj
.GetFromClipboard
If .GetFormat(FORMAT_TEXT) = True Then
.SetText Replace(.GetText(FORMAT_TEXT), vbNewLine, vbNewLine &
vbNewLine)
.PutInClipboard
End If

End With

End Sub

NickHK

"StargateFanFromWork" wrote in message
...
If I have this type of thing in a workbook:

Information in row A
Information in row B
Information in row C
Information in row D




Is there a way to have Excel add an extra line to what we copy to the
clipboard so that when we paste the data, we get this instead of the

above?:

Information in row A

Information in row B

Information in row C

Information in row D


It feels like a longshot but so many times I've been surprised at what

Excel
can do by what you've all shown me in this group, that I'm putting the
message out there anyway.

Thanks much! :oD




Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
May be a long-shot, but..... [email protected] Excel Worksheet Functions 3 July 4th 08 01:03 PM
Copy Titles in a long list of rows toolate88 Excel Discussion (Misc queries) 2 September 11th 07 01:55 AM
inserting multiple rows in one shot? Greg Excel Discussion (Misc queries) 3 June 28th 06 07:26 PM
Long shot - bookmap kayos Excel Programming 8 June 2nd 05 04:04 PM


All times are GMT +1. The time now is 09:15 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"