Welcome to the { mindfrost82.com } forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact contact us.

Go Back   { mindfrost82.com } > Gadget Corner > Tech Newsgroups > Microsoft > MS Office > Excel

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 05-22-2008, 10:02 PM
JB
 
Posts: n/a
macro

Hello
I have created a spreadsheet for filling in details in a section and I want
the user to input the data as and when it's needed. It contains the field
headers to guide the user to fill-in the correct data)
I created a macro to copy the section of the spreadsheet i.e. rows 3 to 10
and paste them below, which would be from 11 onwards. but I want to be able
to run the macro again but paste the section below the last one that was
pasted.
When I run it, it pastes over the first section I pasted when recording the
macro. In other words, how do I do it so that it targets the next empty row
after the last section?.
I hope that makes sense
Excel 2003


Reply With Quote
  #2 (permalink)  
Old 05-22-2008, 10:30 PM
=?Utf-8?B?RGF2ZQ==?=
 
Posts: n/a
RE: macro

Hi,
If you post a copy of your macro, we could suggest the changes needed.
Regards - Dave.
Reply With Quote
  #3 (permalink)  
Old 05-22-2008, 10:36 PM
AndrewArmstrong
 
Posts: n/a
Re: macro

On May 22, 5:02 pm, "JB" <somehow@somewhere> wrote:
> Hello
> I have created a spreadsheet for filling in details in a section and I want
> the user to input the data as and when it's needed. It contains the field
> headers to guide the user to fill-in the correct data)
> I created a macro to copy the section of the spreadsheet i.e. rows 3 to 10
> and paste them below, which would be from 11 onwards. but I want to be able
> to run the macro again but paste the section below the last one that was
> pasted.
> When I run it, it pastes over the first section I pasted when recording the
> macro. In other words, how do I do it so that it targets the next empty row
> after the last section?.
> I hope that makes sense
> Excel 2003


Use something like this in your code, where your data would be in
columns A to Z

dim lnglastrow as long
lnglastrow=Range("a65536:z65536").end(xlup).row

range("a"&lnglastrow).select
Reply With Quote
  #4 (permalink)  
Old 05-22-2008, 11:21 PM
JB
 
Posts: n/a
Re: macro

Hi
It goes as follows:

Sub ReportIncident()
'
' ReportIncident Macro
'
' Keyboard Shortcut: Ctrl+r
'
Rows("4:20").Select
Selection.Copy
Range("A23").Select
ActiveSheet.Paste
Application.CutCopyMode = False
ActiveWindow.SmallScroll Down:=15
Range("A41").Select
End Sub

So when I do run the next one I want to go from under A41 and so on
Thank you
Jen


"Dave" <Dave@discussions.microsoft.com> wrote in message
news:53A74470-5BE5-4FE8-A4B5-4A6FD32088E8@microsoft.com...
> Hi,
> If you post a copy of your macro, we could suggest the changes needed.
> Regards - Dave.


Reply With Quote
  #5 (permalink)  
Old 05-26-2008, 11:56 AM
JB
 
Posts: n/a
Re: macro

Thank you for your help
Sorry but I'm very basic in this. Where do I put it? do I add it to the
macro or redo it?
Ta

"AndrewArmstrong" <a.armstrong11@comcast.net> wrote in message
news:874071a7-49e2-4028-92f6-e398c7023b9a@m44g2000hsc.googlegroups.com...
> On May 22, 5:02 pm, "JB" <somehow@somewhere> wrote:
>> Hello
>> I have created a spreadsheet for filling in details in a section and I
>> want
>> the user to input the data as and when it's needed. It contains the
>> field
>> headers to guide the user to fill-in the correct data)
>> I created a macro to copy the section of the spreadsheet i.e. rows 3 to
>> 10
>> and paste them below, which would be from 11 onwards. but I want to be
>> able
>> to run the macro again but paste the section below the last one that was
>> pasted.
>> When I run it, it pastes over the first section I pasted when recording
>> the
>> macro. In other words, how do I do it so that it targets the next empty
>> row
>> after the last section?.
>> I hope that makes sense
>> Excel 2003

>
> Use something like this in your code, where your data would be in
> columns A to Z
>
> dim lnglastrow as long
> lnglastrow=Range("a65536:z65536").end(xlup).row
>
> range("a"&lnglastrow).select


Reply With Quote
  #6 (permalink)  
Old 05-26-2008, 09:25 PM
Gord Dibben
 
Posts: n/a
Re: macro

Sub test()
Dim rng1 As Range
Set rng1 = ActiveSheet.Cells(Rows.Count, 1).End(xlUp) _
.Offset(1, 0)
Range("3:10").Copy _
Destination:=rng1
End Sub

Or if rows are selected by user.................

Sub test2()
Dim rng1 As Range
Set rng1 = ActiveSheet.Cells(Rows.Count, 1).End(xlUp) _
.Offset(1, 0)
Selection.Copy _
Destination:=rng1
End Sub


Gord Dibben MS Excel MVP


On Mon, 26 May 2008 11:56:34 +0100, "JB" <somehow@somewhere> wrote:

>Thank you for your help
>Sorry but I'm very basic in this. Where do I put it? do I add it to the
>macro or redo it?
>Ta
>
>"AndrewArmstrong" <a.armstrong11@comcast.net> wrote in message
>news:874071a7-49e2-4028-92f6-e398c7023b9a@m44g2000hsc.googlegroups.com...
>> On May 22, 5:02 pm, "JB" <somehow@somewhere> wrote:
>>> Hello
>>> I have created a spreadsheet for filling in details in a section and I
>>> want
>>> the user to input the data as and when it's needed. It contains the
>>> field
>>> headers to guide the user to fill-in the correct data)
>>> I created a macro to copy the section of the spreadsheet i.e. rows 3 to
>>> 10
>>> and paste them below, which would be from 11 onwards. but I want to be
>>> able
>>> to run the macro again but paste the section below the last one that was
>>> pasted.
>>> When I run it, it pastes over the first section I pasted when recording
>>> the
>>> macro. In other words, how do I do it so that it targets the next empty
>>> row
>>> after the last section?.
>>> I hope that makes sense
>>> Excel 2003

>>
>> Use something like this in your code, where your data would be in
>> columns A to Z
>>
>> dim lnglastrow as long
>> lnglastrow=Range("a65536:z65536").end(xlup).row
>>
>> range("a"&lnglastrow).select


Reply With Quote
Reply

  { mindfrost82.com } > Gadget Corner > Tech Newsgroups > Microsoft > MS Office > Excel


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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

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



All times are GMT. The time now is 03:50 AM.


Powered by vBulletin, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.1.0 ©2007, Crawlability, Inc.
© 1999-2008 mindfrost82.com v11.0


Sponsors:
Don Omar | Image Hosting | Per Insurance | Current Accounts | Loans



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114