View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.misc
Dobbs734 Dobbs734 is offline
external usenet poster
 
Posts: 2
Default Adding a new row with a macro

Thanks Jim,

Although, this did not solve my problem I understand the generic code you
gave me. Specifically what I need is column of data to be copied onto
another sheet where it will be transposed on a row. Then, as I stated before,
to add a new row eachtime that macro is used.

I changed the "sheets" names to the ones I used and changed the "A1:E1" to
the fields I want copied. The error occurs with the "A" after the "Count"
entry, which reads:

"Compile Error: Expected: line number or label or statement or end of
statement"

Any idea of what may be happening?

Thanks again.

--
-Mike


"Jim Thomlinson" wrote:

Here is some generic code to do what you have asked. Note that the
destination is determined by coming up from the bottom of Column A to the
first populated cell and moving down one row from there.

Sub test()
Sheets("Sheet1").Range("A1:E1").Copy _
Destination:=Sheets("Sheet2").Cells(Rows.Count,
"A").End(xlUp).Offset(1, 0)
End Sub
--
HTH...

Jim Thomlinson


"Dobbs734" wrote:

Hi,

This may be a relatively simple question, but I'm having some trouble with
the programing behind it...

What I want to do is to use a macro to copy data from one one sheet to
another. Once the data is copied onto the other sheet, the next time you use
the macro, it would automatically make a new row of data instead of
overwriting the existing row. How would I do that?

--
-Mike