Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Simple line fix request.


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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Simple line fix request.

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Simple line fix request.


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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Simple line fix request.

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Simple line fix request.


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
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
simple bar and line chart betsy Charts and Charting in Excel 1 February 12th 09 11:35 PM
Request for VB to do something simple (insert text in a column ofcells) David Nebenzahl Excel Discussion (Misc queries) 5 November 21st 07 04:24 AM
Here is a simple formula request from a newb Darryl Excel Worksheet Functions 5 July 27th 06 08:51 PM
DATEDIF Simple request TAS-LGS Excel Worksheet Functions 1 October 26th 05 01:30 PM
CF in VB Code - Simple Request Kevin Baker[_2_] Excel Programming 2 May 2nd 05 12:34 PM


All times are GMT +1. The time now is 12:09 AM.

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"