Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Macro to Cut-And-Paste Text

Hi,

I'm creating a timeline which has special formatting for each new activity.
I want to create a macro that will insert a new activity at the cursor every
time I run it. So far, I have:

Sub Activity()
'
' Activity Macro
' This macro adds a new activity.
'
' Keyboard Shortcut: Ctrl+Shift+A
'
ActiveWindow.SmallScroll Down:=-36
Rows("9:10").Select
Selection.Copy
ActiveWindow.SmallScroll Down:=30
Rows("42:42").Select
ActiveSheet.Paste
Rows("42:42").Select
Application.CutCopyMode = False
End Sub

But, what this does is paste the text from Rows 9 and 10 always into Rows
42. How can I write the macro so it will paste the text into whatever row is
active?

Thanks!

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 983
Default Macro to Cut-And-Paste Text

Try this...

Sub Activity()
'
' Activity Macro
' This macro adds a new activity.
'
' Keyboard Shortcut: Ctrl+Shift+A
'
Rows("9:10").Copy ActiveCell.EntireRow

Application.CutCopyMode = False
End Sub

HTH

"whyloo" wrote:

Hi,

I'm creating a timeline which has special formatting for each new activity.
I want to create a macro that will insert a new activity at the cursor every
time I run it. So far, I have:

Sub Activity()
'
' Activity Macro
' This macro adds a new activity.
'
' Keyboard Shortcut: Ctrl+Shift+A
'
ActiveWindow.SmallScroll Down:=-36
Rows("9:10").Select
Selection.Copy
ActiveWindow.SmallScroll Down:=30
Rows("42:42").Select
ActiveSheet.Paste
Rows("42:42").Select
Application.CutCopyMode = False
End Sub

But, what this does is paste the text from Rows 9 and 10 always into Rows
42. How can I write the macro so it will paste the text into whatever row is
active?

Thanks!

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
Macro to find text string in a column and paste data in another nicolascap Excel Discussion (Misc queries) 8 March 14th 06 03:13 PM
Copy and Paste macro needs to paste to a changing cell reference loulou Excel Programming 0 February 24th 05 10:29 AM
Macro to Paste to specific line, and continue to Paste each time on next row not over tomkarakowski[_2_] Excel Programming 1 May 28th 04 06:50 PM
Macro-Text from word doc paste to excel empty row J Excel Programming 1 July 26th 03 04:22 AM


All times are GMT +1. The time now is 05:28 AM.

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

About Us

"It's about Microsoft Excel"