Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() As I am only a hack when it comes to programming I need a little hel with something that I’m sure is really easy. I kinda have a program that records data for a day and then at the en of the day adds it to the end of another spreadsheet that keep all th records. I wanted to merger the file so it is all in one spreadsheet. The cod below is what the data file is but I don’t know how to change the lik to make it just reflect the “trade history” worksheet now instead o this other file. Sorry for being so stupid. Set destWB = Workbooks.Open("C:\Documents and Settings\Da Smith\Taris\Admin\Execution\Taris 2005 Data-Ver1 1.xls" -- sungen9 ----------------------------------------------------------------------- sungen99's Profile: http://www.excelforum.com/member.php...nfo&userid=914 View this thread: http://www.excelforum.com/showthread.php?threadid=50491 |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Assume DestWb is dimmed as Workbook. If so, you can't just redim it to be a
worksheet and point it at a worksheet without adjusting all code that used it to expect a worksheet. Dim DestWb as Worksheet set DestWb = Worksheets("Trade History") but you would need to make other adjustments -- Regards, Tom Ogilvy "sungen99" wrote in message ... As I am only a hack when it comes to programming I need a little help with something that I'm sure is really easy. I kinda have a program that records data for a day and then at the end of the day adds it to the end of another spreadsheet that keep all the records. I wanted to merger the file so it is all in one spreadsheet. The code below is what the data file is but I don't know how to change the like to make it just reflect the "trade history" worksheet now instead of this other file. Sorry for being so stupid. Set destWB = Workbooks.Open("C:\Documents and Settings\Dan Smith\Taris\Admin\Execution\Taris 2005 Data-Ver1 1.xls") -- sungen99 ------------------------------------------------------------------------ sungen99's Profile: http://www.excelforum.com/member.php...fo&userid=9144 View this thread: http://www.excelforum.com/showthread...hreadid=504919 |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() This is my code that does this. does this help you more? Sub copy_to_another_workbook() Dim sourceRange As Range Dim destrange As Range Dim destWB As Workbook Dim Lr As Long Application.ScreenUpdating = False Set destWB = Workbooks.Open("C:\Data-Ver1 1.xls") Lr = LastRow(destWB.Worksheets("At A Glance")) + 1 Set sourceRange = ThisWorkbook.Worksheets("Today").Range("A2:N500") Set destrange = destWB.Worksheets("At A Glance").Range("A" & Lr) sourceRange.Copy destrange.PasteSpecial xlPasteValues, , False, False Application.CutCopyMode = False destWB.Close True -- sungen99 ------------------------------------------------------------------------ sungen99's Profile: http://www.excelforum.com/member.php...fo&userid=9144 View this thread: http://www.excelforum.com/showthread...hreadid=504919 |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Dim destWS as Worksheet
Set destWS = ThisWorkbook.Worksheets("Trade History") Lr = LastRow(destWS) + 1 Set sourceRange = ThisWorkbook.Worksheets("Today").Range("A2:N500") Set destrange = destWS.Range("A" & Lr) sourceRange.Copy destrange.PasteSpecial xlPasteValues, , False, False Application.CutCopyMode = False -- Regards, Tom Ogilvy "sungen99" wrote in message ... This is my code that does this. does this help you more? Sub copy_to_another_workbook() Dim sourceRange As Range Dim destrange As Range Dim destWB As Workbook Dim Lr As Long Application.ScreenUpdating = False Set destWB = Workbooks.Open("C:\Data-Ver1 1.xls") Lr = LastRow(destWB.Worksheets("At A Glance")) + 1 Set sourceRange = ThisWorkbook.Worksheets("Today").Range("A2:N500") Set destrange = destWB.Worksheets("At A Glance").Range("A" & Lr) sourceRange.Copy destrange.PasteSpecial xlPasteValues, , False, False Application.CutCopyMode = False destWB.Close True -- sungen99 ------------------------------------------------------------------------ sungen99's Profile: http://www.excelforum.com/member.php...fo&userid=9144 View this thread: http://www.excelforum.com/showthread...hreadid=504919 |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() Never mind... i missed something. thanks again!!!! -- sungen99 ------------------------------------------------------------------------ sungen99's Profile: http://www.excelforum.com/member.php...fo&userid=9144 View this thread: http://www.excelforum.com/showthread...hreadid=504919 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
simple bar and line chart | Charts and Charting in Excel | |||
Request for VB to do something simple (insert text in a column ofcells) | Excel Discussion (Misc queries) | |||
Here is a simple formula request from a newb | Excel Worksheet Functions | |||
DATEDIF Simple request | Excel Worksheet Functions | |||
CF in VB Code - Simple Request | Excel Programming |