automating copy to last cell of column

P

Papa Jonah

I routinely make charts in Excel after exporting data from Access. As I am a
novice I typically do this through a difficult process of cutting and
pasting. I am trying to add some automation to this process.
One thing that I do is I cut two columns from an Excel file that I use as a
template and paste into my active sheet. These columns have formulas that
reference cells in my active sheet. Then I drag the cells to the last row of
the active sheet as necessary. I am writing a macro to paste the formulas,
but I do not know how to write the macro so that it identifies the last row
with data and copies the formulas to that point.
Any help would be greatly appreciated.
 
G

Gord Dibben

Papa

Sub findbottom()
ActiveSheet.Cells(Rows.Count, 1).End(xlUp) _
.Offset(1, 0).Select
End Sub


Will take you to the first row after end of data in Column A.

An example for copying to that row.

Sub Copyit()
Range("1:1").Copy Destination:= _
ActiveSheet.Cells(Rows.Count, 1).End(xlUp) _
.Offset(1, 0)
End Sub

Gord Dibben Excel MVP

On Wed, 13 Oct 2004 14:39:04 -0700, "Papa Jonah" <Papa
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top