View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
joel[_250_] joel[_250_] is offline
external usenet poster
 
Posts: 1
Default Excel 2003 - Macro Help


When you copy a range of cells you only have to specify in the
destination l;ocation the 1st cell of the range like I did below.



Private Sub CommandButton1_Click()

FName = "c:\temp\abc.xls"
bk = Workbooks.Open(Filename:=FName)

With bk.Sheets("Data")
Lastrow = .Range("A" & Rows.Count).End(xlUp).Row
NewRow = Lastrow + 1

ThisWorkbook.Sheets("Template").Rnage("B9:B34").Co py _
Destination:=.Range("A" & NewRow)
End With

bk.Close savechanges:=False


End Sub


--
joel
------------------------------------------------------------------------
joel's Profile: http://www.thecodecage.com/forumz/member.php?userid=229
View this thread: http://www.thecodecage.com/forumz/sh...d.php?t=157082

Microsoft Office Help