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: 247
Default VERY Basic Define Variables Help Needed

The following is step one in what is turning out to be a complex
(at least for me) procedure.
I hope someone has the patience to walk me thru these basics. I feel like
I'm missing a few "keys", in understanding the terminolgy, etc., as it
relates
to defining variables.

Option Explicit
Sub SeqNum()
' Quote Number Macro
' 9-27-05: To assign quote number to Contract forms
' Keyboard Shortcut: Ctrl+Shift+Q
' Salesman has saved the contract with a new name (unknown name)
' The following (from McGimpsey & Associates) is to insert new File name
' of new Contract to Cell G42, of the contract
' (The file name will be different each time this procedure is used).

Dim RngToCopy As Range
Dim DestCell As Range

'THE FOLLOWING is what is causing the grief, so far.
' The 1st G42, "Compile Error, Variable not Defined

Total = Mid(Left(CELL("filename", G42), Find("]", _
CELL("filename", G42)) - 1), Find("[", CELL("filename", G42)) + 1, 255)


' File QCNUM.xls to be opened
' File name in G42 to be copied to F8 in QCNUM.xls
' Will try to use the file name to direct the further required copying
and pasting
' instructions into the correct file. (to be added later)


' To Copy FROM (Newly Named Quote, Cell G42)
With Workbooks(Cell G42).Worksheets("Contract")
Set RngToCopy = .Range("G42")

' To Paste INTO (QCNUM.xls must be opened first)
With Workbooks(c:\Excel Add_Ins\QCNUM.xls).Worksheets("Sheet1").Open
Set DestCell = .Range("F8")
End With

'Save and Close QCNUM.xls
With Workbooks("QCNUM.xls")
.Save
.Close SaveChanges:=True
End With

End Sub

'There is a lot more to come, but I don't feel the rest will be near as tough
as this is (to me)
Thanks in advance.

 
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
How to use variables to define range Dolemite Excel Programming 4 August 12th 05 06:12 PM
How do you define variables in excel? BigRon Excel Discussion (Misc queries) 6 April 16th 05 08:47 PM
Help needed with basic MACRO londonal[_2_] Excel Programming 1 October 8th 04 06:20 PM
Help needed with basic MACRO londonal Excel Programming 0 October 8th 04 05:53 PM
Could we define series variables in one statement? Together[_7_] Excel Programming 1 March 1st 04 07:04 AM


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