Thread: Starting Out
View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Arif Ali[_2_] Arif Ali[_2_] is offline
external usenet poster
 
Posts: 16
Default Starting Out

There are many good books available in any good bookstore or on Amazon.

If you need something simple to start with you can simply create a macro,
assign a keycode to it (like Control-K) and put the following code in it:

Sheets("SheetName").Range("a1").value = "InitalValue1"
Sheets("SheetName").Range("b1").value = "InitalValue2"
etc.

Alternatively, you can create some code and a button on a UserForm as follows:

1. create a userform with a button on it. The Button Caption (label) can be
"Reset Values".

2. In the Workbook_Load event you can include the line

UserForm.Show

3. In the button_ Click event, You can simply write the following:

Dim ExcelApp as Excel.Application
Dim MySheet as Excel.Sheet
' set ExcelApp to the existing application
Set ExcelApp = GetObject (,"Excel.Application")

Set MySheet = ExcelApp.Sheets("whateeveryoursheetNameis")

MySheet.Range("A1").value = initalvalue1
MySheet.Range("B1").value = initalvalue2

..
..
..

Hope this helps.

Arif


"trilogy" wrote:


Hello

I have been dabbling with excel spreadsheets for a while and now need
to learn how to use VB (Ineed it to help me reset the values of my
variable cells).

Could you please guide me in the right direction, as to where I need to
go to learn how to write functions and formulas in VB.

Thank you
Trilogy


--
trilogy
------------------------------------------------------------------------
trilogy's Profile: http://www.excelforum.com/member.php...o&userid=36833
View this thread: http://www.excelforum.com/showthread...hreadid=566500