Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 32
Default Macro to copy and paste

I need a macro that will copy information from a specific range of cells
(A1:A3, for example) and paste that information into a selected range of
cells. Here's the catch: after new info is input and copied, I would like
for it to be pasted in the range of cells directly below whatever info was
previously copied and pasted without deleting the info previously copied and
pasted.

For example:
Type Name Address Phone Number in Cells A1, A2, A3, respectively. Run macro
to copy information from A1:A3 and paste it in B1:B3. Return to Cell A1 and
type Taylor, 123 4th St, 999-9999 in cells A1, A2, A3, respectively. Run
same macro as above with command that will paste this new information in
cells C1:C3 (directly below previously entered info). I hope this makes
sense?
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 78
Default Macro to copy and paste

On 14 mei, 17:56, Taylor wrote:
I need a macro that will copy information from a specific range of cells
(A1:A3, for example) and paste that information into a selected range of
cells. *Here's the catch: *after new info is input and copied, I would like
for it to be pasted in the range of cells directly below whatever info was
previously copied and pasted without deleting the info previously copied and
pasted. *

For example:
Type Name Address Phone Number in Cells A1, A2, A3, respectively. *Run macro
to copy information from A1:A3 and paste it in B1:B3. *Return to Cell A1 and
type Taylor, 123 4th St, 999-9999 in cells A1, A2, A3, respectively. *Run
same macro as above with command that will paste this new information in
cells C1:C3 (directly below previously entered info). *I hope this makes
sense?


Hi Taylor,

I think tou have your Columns and Rows mixed up a bit.
If you use the columns across there is only room for 255 names.

If you use the rows there is room for at least 16000 names, acording
to the version of excel you are using.
This might help:

Sub CopyToFirstEmptyRow()

Range("A1:C1").Copy

If IsEmpty(Range("A2")) Then
Range("A2").Select
Else
If IsEmpty(Range("A3")) Then
Range("A3").Select
Else
Range("A2").End(xlDown).Offset(1, 0).Select
End If
End If
ActiveSheet.Paste
Range("A1:C1").ClearContents

' Start Bonuspart
Range(Cells(2, 1), Cells(ActiveCell.Row, 3)).Select
Selection.Sort Key1:=Range("A2"), Order1:=xlAscending, _
Header:=xlGuess, OrderCustom:=1, MatchCase:=False, _
Orientation:=xlTopToBottom, _
DataOption1:=xlSortTextAsNumbers
' End Bonuspart
Range("A1").Select
End Sub


HTH,
RadarEye
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 32
Default Macro to copy and paste

You are exactly right, friend! Thank you so much for your help--it works
like a charm!

"RadarEye" wrote:

On 14 mei, 17:56, Taylor wrote:
I need a macro that will copy information from a specific range of cells
(A1:A3, for example) and paste that information into a selected range of
cells. Here's the catch: after new info is input and copied, I would like
for it to be pasted in the range of cells directly below whatever info was
previously copied and pasted without deleting the info previously copied and
pasted.

For example:
Type Name Address Phone Number in Cells A1, A2, A3, respectively. Run macro
to copy information from A1:A3 and paste it in B1:B3. Return to Cell A1 and
type Taylor, 123 4th St, 999-9999 in cells A1, A2, A3, respectively. Run
same macro as above with command that will paste this new information in
cells C1:C3 (directly below previously entered info). I hope this makes
sense?


Hi Taylor,

I think tou have your Columns and Rows mixed up a bit.
If you use the columns across there is only room for 255 names.

If you use the rows there is room for at least 16000 names, acording
to the version of excel you are using.
This might help:

Sub CopyToFirstEmptyRow()

Range("A1:C1").Copy

If IsEmpty(Range("A2")) Then
Range("A2").Select
Else
If IsEmpty(Range("A3")) Then
Range("A3").Select
Else
Range("A2").End(xlDown).Offset(1, 0).Select
End If
End If
ActiveSheet.Paste
Range("A1:C1").ClearContents

' Start Bonuspart
Range(Cells(2, 1), Cells(ActiveCell.Row, 3)).Select
Selection.Sort Key1:=Range("A2"), Order1:=xlAscending, _
Header:=xlGuess, OrderCustom:=1, MatchCase:=False, _
Orientation:=xlTopToBottom, _
DataOption1:=xlSortTextAsNumbers
' End Bonuspart
Range("A1").Select
End Sub


HTH,
RadarEye

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 copy and paste values (columns)I have a macro file built C02C04 Excel Programming 2 May 2nd 08 01:51 PM
copy multiple worksheets of a workbook, and paste onto a Word document ( either create new doc file or paste onto an existing file.) I need this done by VBA, Excel Macro Steven Excel Programming 1 October 17th 05 08:56 AM
Copy and Paste macro needs to paste to a changing cell reference loulou Excel Programming 0 February 24th 05 10:29 AM
how to count/sum by function/macro to get the number of record to do copy/paste in macro tango Excel Programming 1 October 15th 04 01:16 PM
Macro to Copy/Paste then Paste to Next Line tomkarakowski Excel Programming 1 May 28th 04 01:19 AM


All times are GMT +1. The time now is 03:48 PM.

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"