Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 20
Default macros creating

Being new to Macros in Excel I just tried creating a simple exercise as
follows.
I have stored a value in cell j6 (row 1, col 10). I wish to check the value
if it is 300 and if so, store valueof 500 in cell j7(row 1, col 11).

The script I entered in VB script editor. But when I executed the macro, I
encountered error.

defining a integer or string in VB is using
DIM ctr as integer
DIM flag as string.

Pl let me know how to define the cells in VB script(where I want the results
to be stored) i.e.,


Sub Macro1()

'
If j6 300 Then
j7 = 500


End If

'Application.CommandBars("Stop Recording").Visible = False
'Range("J8").Select
'Application.Goto Reference:="Macro1"
ActiveWorkbook.Save
ActiveWindow.SmallScroll Down:=-27
Range("K4").Select
Application.Goto Reference:="Macro1"
Application.WindowState = xlMinimized
Application.Goto Reference:="Macro1"
Application.Run "'dynam PROFORMA.xls'!Macro1"
ActiveWindow.ScrollColumn = 2
ActiveWindow.ScrollRow = 2
ActiveWindow.ScrollRow = 3
ActiveWindow.ScrollRow = 4
ActiveWindow.ScrollRow = 5
ActiveWindow.ScrollRow = 4
ActiveWindow.ScrollRow = 3
ActiveWindow.ScrollRow = 2
ActiveWindow.ScrollRow = 1
ActiveWindow.ScrollColumn = 3
Range("K6").Select
ActiveCell.FormulaR1C1 = "300"
Range("K6").Select
ActiveCell.FormulaR1C1 = "301"
Range("J6").Select
ActiveCell.FormulaR1C1 = "301"
Range("K6").Select
ActiveCell.FormulaR1C1 = " "
Range("J6").Select
ActiveWorkbook.Save
Range("J7").Select
Application.Width = 599.25
Application.Height = 429
Application.Run "'dynam PROFORMA.xls'!Macro1"
Application.CommandBars("Exit Design Mode").Visible = False
Range("J6").Select
ActiveWorkbook.Save
ActiveWorkbook.Save
End Sub
Tools - Macros -

--
reply to my posts are welcome
Thanks
 
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
creating macros in excel ryanzoo06 Excel Discussion (Misc queries) 1 May 15th 07 07:43 PM
Creating a new formula(s) and/or macros mslabbe Excel Discussion (Misc queries) 2 December 31st 06 05:03 PM
creating excel macros Dick Excel Worksheet Functions 0 June 2nd 06 06:56 PM
Creating Inventory Macros Rubix Excel Worksheet Functions 2 March 15th 06 01:02 AM
Macros-creating new sheets Bonbon Excel Worksheet Functions 3 February 17th 06 09:44 AM


All times are GMT +1. The time now is 02:53 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"