Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 163
Default Excel 2003 - Macro Help

Hi all Excel Gurus,

I need help. I have an excel workbook with a sheet called template and i
want to create a button to copy a selection of data which is B9:B34 and i
need it to paste the information to another excel workbook with a sheet
called data which will be A:AA and add each row when pressed. When the data
has been copied over i need it to close the data sheet.

Can someone help me please?
  #2   Report Post  
Posted to microsoft.public.excel.programming
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

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Excel 2003 Macro vitamin.c Excel Discussion (Misc queries) 2 December 2nd 09 09:06 PM
Excel 2003 Macro help Fishnerd Excel Programming 7 January 13th 08 09:42 PM
Excel 2003 Macro Tanisha Excel Worksheet Functions 5 August 1st 06 09:31 PM
Macro in Excel 2003 Vicki Excel Programming 1 November 25th 05 10:35 PM
macro in excel 2003 constance Excel Worksheet Functions 1 March 21st 05 09:50 AM


All times are GMT +1. The time now is 10:13 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"