LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default What am I doing wrong? Sending values from one worksheet to another in new workbook

Well, I have this and it works on one template, but for some reason whe
I tried to adapt it to another I ran into a snag... it works so far a
to open up the other workbook as it is supposed to, but then it give
me a subscript out of range error? I'm confused, I'm trying to sen
from the "Customer Quote" worksheet in one workbook, to the "Sale
Invoice" worksheet of another workbook...The cells are in the sam
location on one worksheet as they are on the other, did I do somethin
wrong?


Code
-------------------
Private Sub CommandButton1_Click()
Dim iLastRow As Long
Dim ans
ans = MsgBox("Are you sure you want to convert the current quote into an Invoice?", vbYesNo)
If ans = vbYes Then
Workbooks.Open Filename:="C:\SyntheticShield\SyntheticShieldInvoi ce.XLT"
With ActiveWorkbook
Sheets("Sales Invoice").Range("D13").Value = ThisWorkbook.Sheets("Customer Quote"). _
Range("D13").Value
Sheets("Sales Invoice").Range("D14").Value = ThisWorkbook.Sheets("Customer Quote"). _
Range("D14").Value
Sheets("Sales Invoice").Range("D15").Value = ThisWorkbook.Sheets("Customer Quote"). _
Range("D15").Value
Sheets("Sales Invoice").Range("D16").Value = ThisWorkbook.Sheets("Customer Quote"). _
Range("D16").Value
Sheets("Sales Invoice").Range("G15").Value = ThisWorkbook.Sheets("Customer Quote"). _
Range("G15").Value
Sheets("Sales Invoice").Range("G16").Value = ThisWorkbook.Sheets("Customer Quote"). _
Range("G16").Value
Sheets("Sales Invoice").Range("L13").Value = ThisWorkbook.Sheets("Customer Quote"). _
Range("L13").Value
Sheets("Sales Invoice").Range("L14").Value = ThisWorkbook.Sheets("Customer Quote"). _
Range("L14").Value
Sheets("Sales Invoice").Range("L15").Value = ThisWorkbook.Sheets("Customer Quote"). _
Range("L15").Value
Sheets("Sales Invoice").Range("L16").Value = ThisWorkbook.Sheets("Customer Quote"). _
Range("L16").Value
Sheets("Sales Invoice").Range("O15").Value = ThisWorkbook.Sheets("Customer Quote"). _
Range("O15").Value
Sheets("Sales Invoice").Range("N16").Value = ThisWorkbook.Sheets("Customer Quote"). _
Range("N16").Value
Sheets("Sales Invoice").Range("C19:C35").Value = ThisWorkbook.Sheets("Customer Quote"). _
Range("C19:C35").Value
Sheets("Sales Invoice").Range("D19:D35").Value = ThisWorkbook.Sheets("Customer Quote"). _
Range("D19:D35").Value
Sheets("Sales Invoice").Range("E38").Value = ThisWorkbook.Sheets("Customer Quote"). _
Range("E38").Value
Sheets("Sales Invoice").Range("E40").Value = ThisWorkbook.Sheets("Customer Quote"). _
Range("E40").Value
Sheets("Sales Invoice").Range("E42").Value = ThisWorkbook.Sheets("Customer Quote"). _
Range("E42").Value
Sheets("Sales Invoice").Range("E44").Value = ThisWorkbook.Sheets("Customer Quote"). _
Range("E44").Value
Sheets("Sales Invoice").Range("E47").Value = ThisWorkbook.Sheets("Customer Quote"). _
Range("E47").Value
Sheets("Sales Invoice").Range("E49").Value = ThisWorkbook.Sheets("Customer Quote"). _
Range("E49").Value
Sheets("Sales Invoice").Range("E51").Value = ThisWorkbook.Sheets("Customer Quote"). _
Range("E51").Value
Sheets("Sales Invoice").Range("E53").Value = ThisWorkbook.Sheets("Customer Quote"). _
Range("E53").Value
Sheets("Sales Invoice").Range("I47").Value = ThisWorkbook.Sheets("Customer Quote"). _
Range("I47").Value
ActiveWindow.ActivatePrevious
ActiveWorkbook.Close False
End With
End If
End Sub

-------------------


--
Message posted from http://www.ExcelForum.com

 
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
Copy values of worksheet a to workbook b Nev Excel Discussion (Misc queries) 5 April 8th 09 09:35 PM
Sending a single worksheet from a workbook Lisa Excel Discussion (Misc queries) 3 January 25th 09 05:30 PM
Saving a Worksheet/Workbook with VALUES ONLY CAT Excel Discussion (Misc queries) 4 October 2nd 08 06:50 PM
sending a worksheet from a workbook electronically compliance data Excel Discussion (Misc queries) 2 December 21st 06 04:33 PM
Sending 1 worksheet of a workbook as email file attachment JLG Excel Discussion (Misc queries) 1 February 28th 06 03:15 AM


All times are GMT +1. The time now is 01:20 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"