PC Review


Reply
Thread Tools Rate Thread

Copy with a macro

 
 
pcor
Guest
Posts: n/a
 
      23rd Jul 2010
This works fine.....but I dare ask for a small improvement. Is there a
way
the the program could find the next empty line in block a and palce
the info
there.
Thanks
Ian M
----- Original Message -----
From: "Dave Peterson" <(E-Mail Removed)>
Newsgroups: microsoft.public.excel.programming
Sent: Friday, July 23, 2010 1:01 PM
Subject: Re: Macro to copy


> You could add a button from the Forms toolbar (or use a shortcut key or
> even Alt-F8) to run a macro that copies the cell with the activecell on
> it:
>
> Option Explicit
> Sub testme()
>
> Dim NextRow As Long
>
> With ActiveSheet
>
> 'after the end of the first group, but before the start
> 'of the second. I used row 88.
> NextRow = .Cells(88, "A").End(xlUp).Row + 1
>
> 'some minor checks
> If ActiveCell.Row < 100 Then
> Beep
> 'or give a message
> MsgBox "Move to the second group!"
> Else
> ActiveCell.EntireRow.Copy _
> Destination:=.Cells(NextRow, "A")
> End If
> End With
> End Sub
>
>
> If you're new to macros:
>
> Debra Dalgleish has some notes how to implement macros here:
> http://www.contextures.com/xlvba01.html
>
> David McRitchie has an intro to macros:
> http://www.mvps.org/dmcritchie/excel/getstarted.htm
>
> Ron de Bruin's intro to macros:
> http://www.rondebruin.nl/code.htm
>
> (General, Regular and Standard modules all describe the same thing.)
>
>
> On 07/23/2010 09:26, (E-Mail Removed) wrote:
>> I have a sheet that comrpise TWO blocks of data
>> Block A goes from A1 to g20 displays chores that HAVE been done
>> Block B goes from A100 to G130 displays chores that HAVE TO BE DONE
>> Once a chore is done I want to select that line in block B and have a
>> macro copy that line to the bottom of block A above
>> I would appreciate any help you can give me
>> thanks

>
> --
> Dave Peterson
>



 
Reply With Quote
 
 
 
 
Don Guillett Excel MVP
Guest
Posts: n/a
 
      23rd Jul 2010
On Jul 23, 1:15*pm, pcor <ianma...@hotmail.com> wrote:
> This works fine.....but I dare ask for a small improvement. Is there a
> way
> the the program could find the next empty line in block a and palce
> the info
> there.
> Thanks
> Ian M
>
>
>
> ----- Original Message -----
> From: "Dave Peterson" <peter...@XSPAMverizon.net>
> Newsgroups: microsoft.public.excel.programming
> Sent: Friday, July 23, 2010 1:01 PM
> Subject: Re: Macro to copy
>
> > You could add a button from the Forms toolbar (or use a shortcut key or
> > even Alt-F8) to run a macro that copies the cell with the activecell on
> > it:

>
> > Option Explicit
> > Sub testme()

>
> > * * Dim NextRow As Long

>
> > * * With ActiveSheet

>
> > * * * * 'after the end of the first group, but before the start
> > * * * * 'of the second. *I used row 88.
> > * * * * NextRow = .Cells(88, "A").End(xlUp).Row + 1

>
> > * * * * 'some minor checks
> > * * * * If ActiveCell.Row < 100 Then
> > * * * * * * Beep
> > * * * * * * 'or give a message
> > * * * * * * MsgBox "Move to the second group!"
> > * * * * Else
> > * * * * * * ActiveCell.EntireRow.Copy _
> > * * * * * * * * Destination:=.Cells(NextRow, "A")
> > * * * * End If
> > * * End With
> > End Sub

>
> > If you're new to macros:

>
> > Debra Dalgleish has some notes how to implement macros here:
> >http://www.contextures.com/xlvba01.html

>
> > David McRitchie has an intro to macros:
> >http://www.mvps.org/dmcritchie/excel/getstarted.htm

>
> > Ron de Bruin's intro to macros:
> >http://www.rondebruin.nl/code.htm

>
> > (General, Regular and Standard modules all describe the same thing.)

>
> > On 07/23/2010 09:26, ianma...@hotmail.com wrote:
> >> I have a sheet that comrpise TWO blocks of data
> >> Block A goes from *A1 to g20 displays chores that HAVE been done
> >> Block B *goes from A100 to G130 displays chores that HAVE TO BE DONE
> >> Once a chore is done I want to select that line in block B and have a
> >> macro copy that line to the bottom of block A above
> >> I would appreciate any help you can give me
> >> thanks

>
> > --
> > Dave Peterson- Hide quoted text -

>
> - Show quoted text -

change
NextRow = .Cells(88, "A").End(xlUp).Row + 1
to
NextRow = .Cells(1, "A").End(xldown).Row + 1

 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Macro to copy a sheet and delete a macro button JoeP Microsoft Excel Programming 8 30th Sep 2009 06:14 PM
Change a Macro - Copy in Columns instead of copy in Rows ytayta555 Microsoft Excel Programming 7 9th May 2009 06:32 PM
Macro to copy and paste values (columns)I have a macro file built C02C04 Microsoft Excel Programming 2 2nd May 2008 01:51 PM
Sorry, No Word Macro Forum. Macro To Search And Copy All Occurances bsmith27 Microsoft Excel Programming 0 25th Apr 2008 02:41 PM
how to count/sum by function/macro to get the number of record to do copy/paste in macro tango Microsoft Excel Programming 1 15th Oct 2004 01:16 PM


Features
 

Advertising
 

Newsgroups
 


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