Macro help #8

Here is what I have:

Sheet3(pcdata)
data is in rows A3:R19
I need  to copy and paste(Macro) this data to
Sheet4(Total)
The first available row is A3 Sheet4(Total)

The Sheet3(pcdata) will be updated daily
the macro needs to paste the data on Sheet4(Total) below the existing data,,
(next available row).
 As I am quite a novice at excel. any help.. is very appreciated.

Thanks
Mike



0
mbrune (6)
5/27/2005 7:32:39 PM
excel 39879 articles. 2 followers. Follow

11 Replies
850 Views

Similar Articles

[PageSpeed] 28

Hi Mike

Try this
http://www.rondebruin.nl/copy1.htm


-- 
Regards Ron de Bruin
http://www.rondebruin.nl



"Mike" <mbrune@insightbb.com> wrote in message news:rBKle.11597$Is4.5585@attbi_s21...
> Here is what I have:
>
> Sheet3(pcdata)
> data is in rows A3:R19
> I need  to copy and paste(Macro) this data to
> Sheet4(Total)
> The first available row is A3 Sheet4(Total)
>
> The Sheet3(pcdata) will be updated daily
> the macro needs to paste the data on Sheet4(Total) below the existing data,,
> (next available row).
> As I am quite a novice at excel. any help.. is very appreciated.
>
> Thanks
> Mike
>
>
> 


0
rondebruin (3789)
5/27/2005 8:51:47 PM
On Fri, 27 May 2005 22:51:47 +0200, "Ron de Bruin"
<rondebruin@kabelfoon.nl> wrote:

>Hi Mike
>
>Try this
>http://www.rondebruin.nl/copy1.htm

hmmmm...I would really like to figure out that section with pulling
data from another workbook.  Is it possible to have the VBA import it
from a CSV onto a dummy tab and the paste it below existing data on a
data tab?  Creating an import macro would not be hard but trying to
get it pasted _below_ the data is one I am stumped on.  Unfortunately
the instructions on your site went right over my head.
0
nope (18)
5/28/2005 2:58:56 AM
Hi

If you copy this function in a normal module

Function LastRow(sh As Worksheet)
    On Error Resume Next
    LastRow = sh.Cells.Find(What:="*", _
                            After:=sh.Range("A1"), _
                            Lookat:=xlPart, _
                            LookIn:=xlFormulas, _
                            SearchOrder:=xlByRows, _
                            SearchDirection:=xlPrevious, _
                            MatchCase:=False).Row
    On Error GoTo 0
End Function

You can use this in your macro then to get the first empty row number

Lr = LastRow(Sheets("Sheet2")) + 1

Look at the macro example on my page and see that this line give you the cell address
Set destrange = Sheets("Sheet2").Range("A" & Lr)

Try it


-- 
Regards Ron de Bruin
http://www.rondebruin.nl



"^'^BatAttaK^'^" <nope@noway.com> wrote in message news:7cnf91908u3gl5g23vknsg61irlqv50tom@4ax.com...
> On Fri, 27 May 2005 22:51:47 +0200, "Ron de Bruin"
> <rondebruin@kabelfoon.nl> wrote:
>
>>Hi Mike
>>
>>Try this
>>http://www.rondebruin.nl/copy1.htm
>
> hmmmm...I would really like to figure out that section with pulling
> data from another workbook.  Is it possible to have the VBA import it
> from a CSV onto a dummy tab and the paste it below existing data on a
> data tab?  Creating an import macro would not be hard but trying to
> get it pasted _below_ the data is one I am stumped on.  Unfortunately
> the instructions on your site went right over my head. 


0
rondebruin (3789)
5/28/2005 8:45:45 PM
Hi

I'm assuming

1. that when you say that A3 is the first available cell in worksheet Total,
there is some data in cell A2

2. that there is data in cell A19 being copied

Also I'm letting you put your own code in that checks the Total worksheet
has 17 spare rows at the end.

Sub aaa()
    Dim m As Long

    m = ThisWorkbook.Sheets("Total").Rows.Count

    m = ThisWorkbook.Sheets("Total").Range("A" & m).End(xlUp).Row + 1

    ThisWorkbook.Sheets("pcdata").[A3:R19].Copy
destination:=ThisWorkbook.Sheets("Total").Range("A" & m)

End Sub


Doug


Mike wrote in message ...
>Here is what I have:
>
>Sheet3(pcdata)
>data is in rows A3:R19
>I need  to copy and paste(Macro) this data to
>Sheet4(Total)
>The first available row is A3 Sheet4(Total)
>
>The Sheet3(pcdata) will be updated daily
>the macro needs to paste the data on Sheet4(Total) below the existing
data,,
>(next available row).
> As I am quite a novice at excel. any help.. is very appreciated.
>
>Thanks
>Mike
>
>
>


0
dug4xl (12)
5/29/2005 3:15:20 PM
Hi, I tried the Lastrow function, I finally got the macro to copy and paste 
to the next sheet,,but it always paste's back over itself, it doesn't 
advance to the next empty row,,I can't figure out what I am doing wrong.



"Ron de Bruin" <rondebruin@kabelfoon.nl> wrote in message 
news:euGb9Y8YFHA.3032@TK2MSFTNGP10.phx.gbl...
> Hi
>
> If you copy this function in a normal module
>
> Function LastRow(sh As Worksheet)
>    On Error Resume Next
>    LastRow = sh.Cells.Find(What:="*", _
>                            After:=sh.Range("A1"), _
>                            Lookat:=xlPart, _
>                            LookIn:=xlFormulas, _
>                            SearchOrder:=xlByRows, _
>                            SearchDirection:=xlPrevious, _
>                            MatchCase:=False).Row
>    On Error GoTo 0
> End Function
>
> You can use this in your macro then to get the first empty row number
>
> Lr = LastRow(Sheets("Sheet2")) + 1
>
> Look at the macro example on my page and see that this line give you the 
> cell address
> Set destrange = Sheets("Sheet2").Range("A" & Lr)
>
> Try it
>
>
> -- 
> Regards Ron de Bruin
> http://www.rondebruin.nl
>
>
>
> "^'^BatAttaK^'^" <nope@noway.com> wrote in message 
> news:7cnf91908u3gl5g23vknsg61irlqv50tom@4ax.com...
>> On Fri, 27 May 2005 22:51:47 +0200, "Ron de Bruin"
>> <rondebruin@kabelfoon.nl> wrote:
>>
>>>Hi Mike
>>>
>>>Try this
>>>http://www.rondebruin.nl/copy1.htm
>>
>> hmmmm...I would really like to figure out that section with pulling
>> data from another workbook.  Is it possible to have the VBA import it
>> from a CSV onto a dummy tab and the paste it below existing data on a
>> data tab?  Creating an import macro would not be hard but trying to
>> get it pasted _below_ the data is one I am stumped on.  Unfortunately
>> the instructions on your site went right over my head.
>
> 


0
mbrune (6)
5/29/2005 7:41:25 PM
Hi Mike

Open a new workbook
Copy this in a module (in this workbook)

Sub copy_1()
    Dim sourceRange As Range
    Dim destrange As Range
    Dim Lr As Long
    Lr = LastRow(Sheets("Sheet2")) + 1
    Set sourceRange = Sheets("Sheet1").Range("A1:C1")
    Set destrange = Sheets("Sheet2").Range("A" & Lr)
    sourceRange.Copy destrange
End Sub

Function LastRow(sh As Worksheet)
    On Error Resume Next
    LastRow = sh.Cells.Find(What:="*", _
                            After:=sh.Range("A1"), _
                            Lookat:=xlPart, _
                            LookIn:=xlFormulas, _
                            SearchOrder:=xlByRows, _
                            SearchDirection:=xlPrevious, _
                            MatchCase:=False).Row
    On Error GoTo 0
End Function

Enter something in A1:C1 in "Sheet1"
Run the macro a few times and you will see that every time you run it
it will copy to the next line in "Sheet2"


-- 
Regards Ron de Bruin
http://www.rondebruin.nl



"Mike" <mbrune@insightbb.com> wrote in message news:FVome.18498$Is4.8332@attbi_s21...
> Hi, I tried the Lastrow function, I finally got the macro to copy and paste to the next sheet,,but it always paste's back over 
> itself, it doesn't advance to the next empty row,,I can't figure out what I am doing wrong.
>
>
>
> "Ron de Bruin" <rondebruin@kabelfoon.nl> wrote in message news:euGb9Y8YFHA.3032@TK2MSFTNGP10.phx.gbl...
>> Hi
>>
>> If you copy this function in a normal module
>>
>> Function LastRow(sh As Worksheet)
>>    On Error Resume Next
>>    LastRow = sh.Cells.Find(What:="*", _
>>                            After:=sh.Range("A1"), _
>>                            Lookat:=xlPart, _
>>                            LookIn:=xlFormulas, _
>>                            SearchOrder:=xlByRows, _
>>                            SearchDirection:=xlPrevious, _
>>                            MatchCase:=False).Row
>>    On Error GoTo 0
>> End Function
>>
>> You can use this in your macro then to get the first empty row number
>>
>> Lr = LastRow(Sheets("Sheet2")) + 1
>>
>> Look at the macro example on my page and see that this line give you the cell address
>> Set destrange = Sheets("Sheet2").Range("A" & Lr)
>>
>> Try it
>>
>>
>> -- 
>> Regards Ron de Bruin
>> http://www.rondebruin.nl
>>
>>
>>
>> "^'^BatAttaK^'^" <nope@noway.com> wrote in message news:7cnf91908u3gl5g23vknsg61irlqv50tom@4ax.com...
>>> On Fri, 27 May 2005 22:51:47 +0200, "Ron de Bruin"
>>> <rondebruin@kabelfoon.nl> wrote:
>>>
>>>>Hi Mike
>>>>
>>>>Try this
>>>>http://www.rondebruin.nl/copy1.htm
>>>
>>> hmmmm...I would really like to figure out that section with pulling
>>> data from another workbook.  Is it possible to have the VBA import it
>>> from a CSV onto a dummy tab and the paste it below existing data on a
>>> data tab?  Creating an import macro would not be hard but trying to
>>> get it pasted _below_ the data is one I am stumped on.  Unfortunately
>>> the instructions on your site went right over my head.
>>
>>
>
> 


0
rondebruin (3789)
5/29/2005 7:48:37 PM
Thank you Ron,,I will give it a try and get back with you.  I can send you 
the file of the project I am working on if you like,, maybe you can tell me 
what I am doing wrong,,


Thanks again Ron, for all the help
Mike


"Ron de Bruin" <rondebruin@kabelfoon.nl> wrote in message 
news:e4wFtdIZFHA.4088@TK2MSFTNGP15.phx.gbl...
> Hi Mike
>
> Open a new workbook
> Copy this in a module (in this workbook)
>
> Sub copy_1()
>    Dim sourceRange As Range
>    Dim destrange As Range
>    Dim Lr As Long
>    Lr = LastRow(Sheets("Sheet2")) + 1
>    Set sourceRange = Sheets("Sheet1").Range("A1:C1")
>    Set destrange = Sheets("Sheet2").Range("A" & Lr)
>    sourceRange.Copy destrange
> End Sub
>
> Function LastRow(sh As Worksheet)
>    On Error Resume Next
>    LastRow = sh.Cells.Find(What:="*", _
>                            After:=sh.Range("A1"), _
>                            Lookat:=xlPart, _
>                            LookIn:=xlFormulas, _
>                            SearchOrder:=xlByRows, _
>                            SearchDirection:=xlPrevious, _
>                            MatchCase:=False).Row
>    On Error GoTo 0
> End Function
>
> Enter something in A1:C1 in "Sheet1"
> Run the macro a few times and you will see that every time you run it
> it will copy to the next line in "Sheet2"
>
>
> -- 
> Regards Ron de Bruin
> http://www.rondebruin.nl
>
>
>
> "Mike" <mbrune@insightbb.com> wrote in message 
> news:FVome.18498$Is4.8332@attbi_s21...
>> Hi, I tried the Lastrow function, I finally got the macro to copy and 
>> paste to the next sheet,,but it always paste's back over itself, it 
>> doesn't advance to the next empty row,,I can't figure out what I am doing 
>> wrong.
>>
>>
>>
>> "Ron de Bruin" <rondebruin@kabelfoon.nl> wrote in message 
>> news:euGb9Y8YFHA.3032@TK2MSFTNGP10.phx.gbl...
>>> Hi
>>>
>>> If you copy this function in a normal module
>>>
>>> Function LastRow(sh As Worksheet)
>>>    On Error Resume Next
>>>    LastRow = sh.Cells.Find(What:="*", _
>>>                            After:=sh.Range("A1"), _
>>>                            Lookat:=xlPart, _
>>>                            LookIn:=xlFormulas, _
>>>                            SearchOrder:=xlByRows, _
>>>                            SearchDirection:=xlPrevious, _
>>>                            MatchCase:=False).Row
>>>    On Error GoTo 0
>>> End Function
>>>
>>> You can use this in your macro then to get the first empty row number
>>>
>>> Lr = LastRow(Sheets("Sheet2")) + 1
>>>
>>> Look at the macro example on my page and see that this line give you the 
>>> cell address
>>> Set destrange = Sheets("Sheet2").Range("A" & Lr)
>>>
>>> Try it
>>>
>>>
>>> -- 
>>> Regards Ron de Bruin
>>> http://www.rondebruin.nl
>>>
>>>
>>>
>>> "^'^BatAttaK^'^" <nope@noway.com> wrote in message 
>>> news:7cnf91908u3gl5g23vknsg61irlqv50tom@4ax.com...
>>>> On Fri, 27 May 2005 22:51:47 +0200, "Ron de Bruin"
>>>> <rondebruin@kabelfoon.nl> wrote:
>>>>
>>>>>Hi Mike
>>>>>
>>>>>Try this
>>>>>http://www.rondebruin.nl/copy1.htm
>>>>
>>>> hmmmm...I would really like to figure out that section with pulling
>>>> data from another workbook.  Is it possible to have the VBA import it
>>>> from a CSV onto a dummy tab and the paste it below existing data on a
>>>> data tab?  Creating an import macro would not be hard but trying to
>>>> get it pasted _below_ the data is one I am stumped on.  Unfortunately
>>>> the instructions on your site went right over my head.
>>>
>>>
>>
>>
>
> 


0
mbrune (6)
5/30/2005 7:19:53 AM
I gave it a try,, I made a new wookbook,,put in your code only,  it still 
does not move to the next line on sheet2 when the macro is run

The macro runs fine,,but it just copies back over itself on sheet2







"Ron de Bruin" <rondebruin@kabelfoon.nl> wrote in message 
news:e4wFtdIZFHA.4088@TK2MSFTNGP15.phx.gbl...
> Hi Mike
>
> Open a new workbook
> Copy this in a module (in this workbook)
>
> Sub copy_1()
>    Dim sourceRange As Range
>    Dim destrange As Range
>    Dim Lr As Long
>    Lr = LastRow(Sheets("Sheet2")) + 1
>    Set sourceRange = Sheets("Sheet1").Range("A1:C1")
>    Set destrange = Sheets("Sheet2").Range("A" & Lr)
>    sourceRange.Copy destrange
> End Sub
>
> Function LastRow(sh As Worksheet)
>    On Error Resume Next
>    LastRow = sh.Cells.Find(What:="*", _
>                            After:=sh.Range("A1"), _
>                            Lookat:=xlPart, _
>                            LookIn:=xlFormulas, _
>                            SearchOrder:=xlByRows, _
>                            SearchDirection:=xlPrevious, _
>                            MatchCase:=False).Row
>    On Error GoTo 0
> End Function
>
> Enter something in A1:C1 in "Sheet1"
> Run the macro a few times and you will see that every time you run it
> it will copy to the next line in "Sheet2"
>
>
> -- 
> Regards Ron de Bruin
> http://www.rondebruin.nl
>
>
>
> "Mike" <mbrune@insightbb.com> wrote in message 
> news:FVome.18498$Is4.8332@attbi_s21...
>> Hi, I tried the Lastrow function, I finally got the macro to copy and 
>> paste to the next sheet,,but it always paste's back over itself, it 
>> doesn't advance to the next empty row,,I can't figure out what I am doing 
>> wrong.
>>
>>
>>
>> "Ron de Bruin" <rondebruin@kabelfoon.nl> wrote in message 
>> news:euGb9Y8YFHA.3032@TK2MSFTNGP10.phx.gbl...
>>> Hi
>>>
>>> If you copy this function in a normal module
>>>
>>> Function LastRow(sh As Worksheet)
>>>    On Error Resume Next
>>>    LastRow = sh.Cells.Find(What:="*", _
>>>                            After:=sh.Range("A1"), _
>>>                            Lookat:=xlPart, _
>>>                            LookIn:=xlFormulas, _
>>>                            SearchOrder:=xlByRows, _
>>>                            SearchDirection:=xlPrevious, _
>>>                            MatchCase:=False).Row
>>>    On Error GoTo 0
>>> End Function
>>>
>>> You can use this in your macro then to get the first empty row number
>>>
>>> Lr = LastRow(Sheets("Sheet2")) + 1
>>>
>>> Look at the macro example on my page and see that this line give you the 
>>> cell address
>>> Set destrange = Sheets("Sheet2").Range("A" & Lr)
>>>
>>> Try it
>>>
>>>
>>> -- 
>>> Regards Ron de Bruin
>>> http://www.rondebruin.nl
>>>
>>>
>>>
>>> "^'^BatAttaK^'^" <nope@noway.com> wrote in message 
>>> news:7cnf91908u3gl5g23vknsg61irlqv50tom@4ax.com...
>>>> On Fri, 27 May 2005 22:51:47 +0200, "Ron de Bruin"
>>>> <rondebruin@kabelfoon.nl> wrote:
>>>>
>>>>>Hi Mike
>>>>>
>>>>>Try this
>>>>>http://www.rondebruin.nl/copy1.htm
>>>>
>>>> hmmmm...I would really like to figure out that section with pulling
>>>> data from another workbook.  Is it possible to have the VBA import it
>>>> from a CSV onto a dummy tab and the paste it below existing data on a
>>>> data tab?  Creating an import macro would not be hard but trying to
>>>> get it pasted _below_ the data is one I am stumped on.  Unfortunately
>>>> the instructions on your site went right over my head.
>>>
>>>
>>
>>
>
> 


0
mbrune (6)
5/31/2005 6:56:24 PM
Send me your test workbook private Mike
I look at it then

-- 
Regards Ron de Bruin
http://www.rondebruin.nl



"Mike" <mbrune@insightbb.com> wrote in message news:sr2ne.23094$Is4.16691@attbi_s21...
>I gave it a try,, I made a new wookbook,,put in your code only,  it still does not move to the next line on sheet2 when the macro 
>is run
>
> The macro runs fine,,but it just copies back over itself on sheet2
>
>
>
>
>
>
>
> "Ron de Bruin" <rondebruin@kabelfoon.nl> wrote in message news:e4wFtdIZFHA.4088@TK2MSFTNGP15.phx.gbl...
>> Hi Mike
>>
>> Open a new workbook
>> Copy this in a module (in this workbook)
>>
>> Sub copy_1()
>>    Dim sourceRange As Range
>>    Dim destrange As Range
>>    Dim Lr As Long
>>    Lr = LastRow(Sheets("Sheet2")) + 1
>>    Set sourceRange = Sheets("Sheet1").Range("A1:C1")
>>    Set destrange = Sheets("Sheet2").Range("A" & Lr)
>>    sourceRange.Copy destrange
>> End Sub
>>
>> Function LastRow(sh As Worksheet)
>>    On Error Resume Next
>>    LastRow = sh.Cells.Find(What:="*", _
>>                            After:=sh.Range("A1"), _
>>                            Lookat:=xlPart, _
>>                            LookIn:=xlFormulas, _
>>                            SearchOrder:=xlByRows, _
>>                            SearchDirection:=xlPrevious, _
>>                            MatchCase:=False).Row
>>    On Error GoTo 0
>> End Function
>>
>> Enter something in A1:C1 in "Sheet1"
>> Run the macro a few times and you will see that every time you run it
>> it will copy to the next line in "Sheet2"
>>
>>
>> -- 
>> Regards Ron de Bruin
>> http://www.rondebruin.nl
>>
>>
>>
>> "Mike" <mbrune@insightbb.com> wrote in message news:FVome.18498$Is4.8332@attbi_s21...
>>> Hi, I tried the Lastrow function, I finally got the macro to copy and paste to the next sheet,,but it always paste's back over 
>>> itself, it doesn't advance to the next empty row,,I can't figure out what I am doing wrong.
>>>
>>>
>>>
>>> "Ron de Bruin" <rondebruin@kabelfoon.nl> wrote in message news:euGb9Y8YFHA.3032@TK2MSFTNGP10.phx.gbl...
>>>> Hi
>>>>
>>>> If you copy this function in a normal module
>>>>
>>>> Function LastRow(sh As Worksheet)
>>>>    On Error Resume Next
>>>>    LastRow = sh.Cells.Find(What:="*", _
>>>>                            After:=sh.Range("A1"), _
>>>>                            Lookat:=xlPart, _
>>>>                            LookIn:=xlFormulas, _
>>>>                            SearchOrder:=xlByRows, _
>>>>                            SearchDirection:=xlPrevious, _
>>>>                            MatchCase:=False).Row
>>>>    On Error GoTo 0
>>>> End Function
>>>>
>>>> You can use this in your macro then to get the first empty row number
>>>>
>>>> Lr = LastRow(Sheets("Sheet2")) + 1
>>>>
>>>> Look at the macro example on my page and see that this line give you the cell address
>>>> Set destrange = Sheets("Sheet2").Range("A" & Lr)
>>>>
>>>> Try it
>>>>
>>>>
>>>> -- 
>>>> Regards Ron de Bruin
>>>> http://www.rondebruin.nl
>>>>
>>>>
>>>>
>>>> "^'^BatAttaK^'^" <nope@noway.com> wrote in message news:7cnf91908u3gl5g23vknsg61irlqv50tom@4ax.com...
>>>>> On Fri, 27 May 2005 22:51:47 +0200, "Ron de Bruin"
>>>>> <rondebruin@kabelfoon.nl> wrote:
>>>>>
>>>>>>Hi Mike
>>>>>>
>>>>>>Try this
>>>>>>http://www.rondebruin.nl/copy1.htm
>>>>>
>>>>> hmmmm...I would really like to figure out that section with pulling
>>>>> data from another workbook.  Is it possible to have the VBA import it
>>>>> from a CSV onto a dummy tab and the paste it below existing data on a
>>>>> data tab?  Creating an import macro would not be hard but trying to
>>>>> get it pasted _below_ the data is one I am stumped on.  Unfortunately
>>>>> the instructions on your site went right over my head.
>>>>
>>>>
>>>
>>>
>>
>>
>
> 


0
rondebruin (3789)
5/31/2005 8:40:29 PM
Ron, it works great, Thank you for the fantastic help!

Mike


"Ron de Bruin" <rondebruin@kabelfoon.nl> wrote in message 
news:%23cfGCEiZFHA.2840@TK2MSFTNGP10.phx.gbl...
> Send me your test workbook private Mike
> I look at it then
>
> -- 
> Regards Ron de Bruin
> http://www.rondebruin.nl
>
>
>
> "Mike" <mbrune@insightbb.com> wrote in message 
> news:sr2ne.23094$Is4.16691@attbi_s21...
>>I gave it a try,, I made a new wookbook,,put in your code only,  it still 
>>does not move to the next line on sheet2 when the macro is run
>>
>> The macro runs fine,,but it just copies back over itself on sheet2
>>
>>
>>
>>
>>
>>
>>
>> "Ron de Bruin" <rondebruin@kabelfoon.nl> wrote in message 
>> news:e4wFtdIZFHA.4088@TK2MSFTNGP15.phx.gbl...
>>> Hi Mike
>>>
>>> Open a new workbook
>>> Copy this in a module (in this workbook)
>>>
>>> Sub copy_1()
>>>    Dim sourceRange As Range
>>>    Dim destrange As Range
>>>    Dim Lr As Long
>>>    Lr = LastRow(Sheets("Sheet2")) + 1
>>>    Set sourceRange = Sheets("Sheet1").Range("A1:C1")
>>>    Set destrange = Sheets("Sheet2").Range("A" & Lr)
>>>    sourceRange.Copy destrange
>>> End Sub
>>>
>>> Function LastRow(sh As Worksheet)
>>>    On Error Resume Next
>>>    LastRow = sh.Cells.Find(What:="*", _
>>>                            After:=sh.Range("A1"), _
>>>                            Lookat:=xlPart, _
>>>                            LookIn:=xlFormulas, _
>>>                            SearchOrder:=xlByRows, _
>>>                            SearchDirection:=xlPrevious, _
>>>                            MatchCase:=False).Row
>>>    On Error GoTo 0
>>> End Function
>>>
>>> Enter something in A1:C1 in "Sheet1"
>>> Run the macro a few times and you will see that every time you run it
>>> it will copy to the next line in "Sheet2"
>>>
>>>
>>> -- 
>>> Regards Ron de Bruin
>>> http://www.rondebruin.nl
>>>
>>>
>>>
>>> "Mike" <mbrune@insightbb.com> wrote in message 
>>> news:FVome.18498$Is4.8332@attbi_s21...
>>>> Hi, I tried the Lastrow function, I finally got the macro to copy and 
>>>> paste to the next sheet,,but it always paste's back over itself, it 
>>>> doesn't advance to the next empty row,,I can't figure out what I am 
>>>> doing wrong.
>>>>
>>>>
>>>>
>>>> "Ron de Bruin" <rondebruin@kabelfoon.nl> wrote in message 
>>>> news:euGb9Y8YFHA.3032@TK2MSFTNGP10.phx.gbl...
>>>>> Hi
>>>>>
>>>>> If you copy this function in a normal module
>>>>>
>>>>> Function LastRow(sh As Worksheet)
>>>>>    On Error Resume Next
>>>>>    LastRow = sh.Cells.Find(What:="*", _
>>>>>                            After:=sh.Range("A1"), _
>>>>>                            Lookat:=xlPart, _
>>>>>                            LookIn:=xlFormulas, _
>>>>>                            SearchOrder:=xlByRows, _
>>>>>                            SearchDirection:=xlPrevious, _
>>>>>                            MatchCase:=False).Row
>>>>>    On Error GoTo 0
>>>>> End Function
>>>>>
>>>>> You can use this in your macro then to get the first empty row number
>>>>>
>>>>> Lr = LastRow(Sheets("Sheet2")) + 1
>>>>>
>>>>> Look at the macro example on my page and see that this line give you 
>>>>> the cell address
>>>>> Set destrange = Sheets("Sheet2").Range("A" & Lr)
>>>>>
>>>>> Try it
>>>>>
>>>>>
>>>>> -- 
>>>>> Regards Ron de Bruin
>>>>> http://www.rondebruin.nl
>>>>>
>>>>>
>>>>>
>>>>> "^'^BatAttaK^'^" <nope@noway.com> wrote in message 
>>>>> news:7cnf91908u3gl5g23vknsg61irlqv50tom@4ax.com...
>>>>>> On Fri, 27 May 2005 22:51:47 +0200, "Ron de Bruin"
>>>>>> <rondebruin@kabelfoon.nl> wrote:
>>>>>>
>>>>>>>Hi Mike
>>>>>>>
>>>>>>>Try this
>>>>>>>http://www.rondebruin.nl/copy1.htm
>>>>>>
>>>>>> hmmmm...I would really like to figure out that section with pulling
>>>>>> data from another workbook.  Is it possible to have the VBA import it
>>>>>> from a CSV onto a dummy tab and the paste it below existing data on a
>>>>>> data tab?  Creating an import macro would not be hard but trying to
>>>>>> get it pasted _below_ the data is one I am stumped on.  Unfortunately
>>>>>> the instructions on your site went right over my head.
>>>>>
>>>>>
>>>>
>>>>
>>>
>>>
>>
>>
>
> 


0
mbrune (6)
6/3/2005 9:54:24 PM
Thank you Doug,, I will give your solution a try also..



"Doug" <dug4xl@hotmail.co.uk> wrote in message 
news:d7cmao$4gs$1@newsg3.svr.pol.co.uk...
> Hi
>
> I'm assuming
>
> 1. that when you say that A3 is the first available cell in worksheet 
> Total,
> there is some data in cell A2
>
> 2. that there is data in cell A19 being copied
>
> Also I'm letting you put your own code in that checks the Total worksheet
> has 17 spare rows at the end.
>
> Sub aaa()
>    Dim m As Long
>
>    m = ThisWorkbook.Sheets("Total").Rows.Count
>
>    m = ThisWorkbook.Sheets("Total").Range("A" & m).End(xlUp).Row + 1
>
>    ThisWorkbook.Sheets("pcdata").[A3:R19].Copy
> destination:=ThisWorkbook.Sheets("Total").Range("A" & m)
>
> End Sub
>
>
> Doug
>
>
> Mike wrote in message ...
>>Here is what I have:
>>
>>Sheet3(pcdata)
>>data is in rows A3:R19
>>I need  to copy and paste(Macro) this data to
>>Sheet4(Total)
>>The first available row is A3 Sheet4(Total)
>>
>>The Sheet3(pcdata) will be updated daily
>>the macro needs to paste the data on Sheet4(Total) below the existing
> data,,
>>(next available row).
>> As I am quite a novice at excel. any help.. is very appreciated.
>>
>>Thanks
>>Mike
>>
>>
>>
>
> 


0
mbrune (6)
6/3/2005 9:57:27 PM
Reply:

Similar Artilces:

help with formulas
hello I am designing a spreadsheet with some formulas to be self counting. I am stock for some certains formulas to creat what I would like to acheive, it is difficult to explaind just by writting. It would be easier if I could send an example of my spreadsheet by an attachment. How can I do that ? Hi don't send an attachment. Just try to explain your question in plain text or post some example rows of your data (also in plain text) -- Regards Frank Kabel Frankfurt, Germany "Jan" <Jan@discussions.microsoft.com> schrieb im Newsbeitrag news:B20CBBD3-F6D4-4AED-B635-DD0...

need help with an excel spreadsheet
I have an excel spreadsheet where questions are answered in one area, and the answers show up on a form in another area of the sheet that gets printed. Instead of printing, how can I either email the print area or have just the print area saved as a file? And, with a macro, can the new file be named automatically by what's in a particular cell? Thanks, Russ You don't say whether the recipient would need to edit the data. If not, there are numerous programs available (free, shareware and commercial) which enable print output to be stored as a PDF file. Another option would be to c...

Macro warning with no macros
I have a workbook that when I try to open it I get the warning tellin me it contains macros and asking whether I want to Enable or Disabl them. I put no macros, no VB scripts, nothing at all in the workboo other than standard Excel formulas and some charts. I developed it i Excel 2002, SP-2, but have moved it back and forth between tw computers, the other which has Excel 97. Regardless of whether Enable or Disable or change the security settings so as not to get th warning, once the workbook is open even if I go t Tools-Macro-Macros... it lists no macros. How can I find out what's cau...

Accessing a 97 database with Access 2000- HELP!
Here is my situation. I have a database that was created in Access 97. It has never been converted yet over to Access 2000. When I try to open the database, I get the usual message of "Do I want to convert the database or just open it" I choose open the database. As soon as I choose this, an error message comes up that says Record is Deleted. I found one article on the Help site that deals with this message but it refers to a networked Access 2000 database. It talks about using the Repair function. I did try the repair function on the 97 version but it did not get rid of th...

Conditional Formula
Hello, I would like some help in evaluating the value of a cell that falls within a certain range. For example: If A2 is less than 1 and greater than 10 "TRUE" Your help is appreciated. Ed Hi Eduardo do you mean if A2 is less than 1 OR greater than 10??? if so format / conditional formatting formula is =OR($A2<1,$A2>10) or if you mean greater than 1 and less than 10 =AND($B1>1,$B1<10) Cheers JulieD "Eduardo" <Eduardo@discussions.microsoft.com> wrote in message news:00BD63BC-81A8-41B9-86F0-BAE57246B86C@microsoft.com... > Hello, > I would li...

Macro
Can anybody tell me how to kick off a macro automatically as file is opened? Regards ...

Macro
Version: 2008 Operating System: Mac OS X 10.4 (Tiger) Processor: intel Hi, I'm thinking of buying Mac: Office 2008, but before I do I want to check that I will be able to download Scritpsmart collection of templates without any glitches: <http://www.bbc.co.uk/writersroom/scriptsmart/faq.shtml> Does anyone know if I can do this? Regards, SP. In article <ee98ff5.-1@webcrossing.caR9absDaxw>, StregaItalia@officeformac.com wrote: > Version: 2008 > Operating System: Mac OS X 10.4 (Tiger) > Processor: intel > > Hi, > > I'm thinking of buying Mac: Of...

HELP !!
I have a long long column of company names ie Company a Company b Company c But some of them are duplicated ie Company a Company b Company b Company b Company c Company c Company c How can I do a count on these companies so that I'm only provided with a count of each individual company name. (rather than the duplicates as well). So the count for the list of duplicates above would be '3'. Any one help???? Regards Dave =SUM(1/COUNTIF(A1:A7,A1:A7)) This formula must be array entered - You must press ctrl+shift+enter (as opposed to just hitting enter) after inserting the...

Run macro automatically.
How do I make a macro run automatically when a worksheet it is attached to is loaded? right click on the sheet tab>view code>left window worksheet>right window activate -- Don Guillett SalesAid Software donaldb@281.com "Excel macro" <Excel macro@discussions.microsoft.com> wrote in message news:DD7AF1E3-9263-4523-AC49-A43ABA1AB9D0@microsoft.com... > How do I make a macro run automatically when a worksheet it is attached to is > loaded? I am unable to find "activate " when I right click on worksheet. ( i assume that you are referring to the windo...

Help with macro/and or formula?
Perhaps this is a silly question, but i just can't figure out how t format this worksheet. The problem is that a lot of the cells hav numbers in them with negative signs in the back instead of in the fron (ie. 23-) and i was wondering if anyone knew of a macro/formula i coul use to quickly fix this problem for all the cells. I would b extremely grateful. Thanks -- brefed1 ----------------------------------------------------------------------- brefed15's Profile: http://www.excelforum.com/member.php?action=getinfo&userid=3557 View this thread: http://www.excelforum.com/showthre...

Attached Toolbars Macros
Excel 2003 I have a custom tool bar, this tool bar has several items, each item is pointing to a VBA code. This tool bar is attached to the worksheet. I've copied this spreadsheet to several computers. After I copied the spreadsheet I decided to rename the spreadsheet, after I renamed the spreadsheet the Toolbar Item's macros were still pointing to the old name, I reasigned each tool bar item to the current spreadsheet, saved the spreadsheet and everything was working on my computer, but when I re-copied the new spreadsheet to other computers and I clicked on the Toolbar Item...

Help with an update
Somebody can tell me why i cant installe update Microsoft .NET Framework 1.1 Service Pack 1 Security Update for Windows 2000, Windows XP, Windows Vista, Windows Server 2008, Windows 7, and Windows Server 2008 R2 (KB953297) I tried to installe update many times but dont work . What i can do...can help me? Thank you. Copied announcement from MowGreen To: *All Windows Users* who encounter installation issues when installing Security updates for .NET Frameworks Every time there's a Security update for .NET Frameworks there is an inordinate amount of posts dealing...

Protected sheets and running macros
i have a sheet with a macro ran by a normal button at the top. Howeve when i protect the worksheet where ever i click on the sheet the macr executes. Can any one offer any advice on how to stop this? Thanks Robert -- Message posted from http://www.ExcelForum.com hi, i am not able to reproduce the problem, hence i may not be able t provide a panacea for that issue. here is what i suggest. i have a sheet that has a macro that is run when a control toolbo button (that is, not a form button) is clicked. this sheet is protected based on the user logged in. what i have don is to protect t...

Lists
Okay I am new to excell bar drawing little spreadsheets to do my own financing. I am currently setting up a sheet and need the users to be able to select from a list of options only and not input thier own text - does that make sense? also i ahve 12 names on the list and one master with all on - would like the data entered on to a names list to be automatically entered onto the master or vice versa which ever is easiest. sorry if this sounds jumbled but i am totally lost and this has to look really hot for work! regards Kelly - England Hi Kerry, don't know a great deal on forms ...

Macro to remove rows?
Hi, I receive thousands of rows of data from an extract that comes from a database. The data extract automatically generates page headers that need to be removed, and I would love to automate this process. The headers do have a pattern to them, but I'm not clever enough to figure out a good way to use that to write a macro. The first row of the header starts with hyphens ------------------------------- Then there's a variable number of rows of header data to delete followed by another row of hyphens ------------------------------- Then 2 additional rows that must be deleted. The nu...

Macro Freezes Reading Pane
I have a macro that Sends/Receives Tasks from Project Server into Outlook Tasks. Everything is working fine, except one weird thing that happens. I have the Timer set on the macro and it starts as soon as Outlook starts. The macro gets the tasks from ProjectServer every hour. As soon as the macro starts running the Reading pane freezes in the Inbox. If i stop the macro then Reading pane is back to normal. Can anyone please tell me if there is something I can do in VBA to fix this annoying issue. Thanks a lot ...

Tracking Sheet help.
Sheet 3 of my workbook is a tracking sheet. In cell B8 (sheet 3) I enter the amount of time's that I've made an entry of time on sheet 2. The times I enter on sheet 2 are used to track vehicles that are passing a set location. On sheet 2 I enter the times in column D. The vehicle's I count have numbers to ID them in column F. The numbers look like 401N1501, 401N1514, 401S1516, 401S1600. The part of the number I need to associate with my count is the first four digits, 401N, 401S. Is it possible to do this? Yep, use a sumproduct function to count using the left 4 digits as...

Calling on a macro within a macro!
Hey All!! Quick Question - How do you call up a macro within a current macro? I have one big macro and I need it to jump to several other macros when it runs! Does it matter where the other macros are stored or is it better to have them all in one module? Help appreciated Thnx! Hi Mellowe, '=============>> Public Sub Main() 'Your code Call One 'your code End Sub '<<============= '=============>> Public Sub One() MsgBox "Hi from One" End Sub '<<============= > Does it matter where the other macros are stored or ...

Please Help Me Secure My Form Results!!!
I have a FP 2003 form on a SSL page that contains confidential information. I would like to send it to a password protected page that my other employees can access with a unique username/password and then print the form results. I currently send it to the _private folder in formatted text– but I am the only one who can access it-- through FP. I tried to setup a subsite – but the Browse button in FrontPage Form Results does not see the subsite. I have tried other forums and paid for advice from “experts” on other sites – but no one seems to be able to tell me exactly how this ...

shortcut keys to macros
Hi, Is it at all possible to assign shortcut keys to macros in Outlook? Thx, Hans ...

help Unable to record Macro !!!!!!!
I want to record a macro in excel.But as soon as I click record Macro it says "unable to record" macro. Got no help in excel help.I do this same thing in word and it's working. Please help It's urgent for me !!!1 Have a look here http://groups.google.com/groups?as_epq=unable%20to%20record&as_ugroup=microsoft.public.excel.* -- Don Guillett SalesAid Software donaldb@281.com "ash" <anonymous@discussions.microsoft.com> wrote in message news:3e0b01c42ae5$45333e00$a401280a@phx.gbl... > I want to record a macro in excel.But as soon as I click > record...

Macro that password protects a sheet
I am attempting to create a macro that can open a protected sheet, change something, and then protect it again. I continue to have an issue with the macro not entering the password. Is this possible to do/fix? Thanks, Ryan ..open password="mypassword" -- Don Guillett SalesAid Software donaldb@281.com "Ryan" <Ryan@discussions.microsoft.com> wrote in message news:D4780ED8-CA1D-4284-97BC-3576160D998E@microsoft.com... > I am attempting to create a macro that can open a protected sheet, change > something, and then protect it again. I continue to have an iss...

Is it possible to pass Certification Exams without proper training? Yes now its possible, this site will help you to download all guides and latest exam material for CISCO, MICROSOFT, ORACLE, COMPTIA,
Is it possible to pass Certification Exams without proper training? Yes now its possible, this site will help you to download all guides and latest exam material for CISCO, MICROSOFT, ORACLE, COMPTIA, LINUX. I received many e-mail from visitor about this site and to feel happy because this one can help you pass your certification exams very easily. Visit http://www.FreeExamKing.com ...

Footer Macro?
Hi Months ago I read a Public Sub Macro that read the selection of a drop down list in a combo box and placed it in the center Footer at the same time it also placed the date in the right Footer and tme in the left footer. I have searched most of the regular sites including this one and cannot find it anywhere --- Can anyone help with my search. Any help much appreciated Cheers ---- Mully ...

Keyboard Shortcut in Macro
Hi all i'v created macro with Keyboard Shortcut Ctrl+b . now i want to change it to Ctrl+z how can i do it . regards Tools-->Macro-->Macros. Select (don't open!) your macro, and hit the Options button. :) ************ Hope it helps! Anne Troy www.OfficeArticles.com "osaka78" <osaka78@discussions.microsoft.com> wrote in message news:1721A458-212D-4446-8209-494A459EE428@microsoft.com... > Hi all > i'v created macro with Keyboard Shortcut Ctrl+b . now i want to change it > to > Ctrl+z > how can i do it . > > regards THE MACRO IS NO...