Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Basic Syntax
I have recently begun learning programming in Excel after coming from a
Matlab background. I find myself constantly running into syntax errors and other 'Bill Gates effects'. For example I use the macro recorder to produce the following simple proceedure... Sub selectrange() Sheets("Data").Select Range("A24").Select Range(Selection, Selection.End(xlDown)).Select End Sub That seems grossly inefficient and so I thought the following line would do the trick... Sub selectrange() Sheets("Data").("a24", "a24".End(xlDown)).Select End Sub but I get a compile error. Can anyone point out my problem, understanding that may help me to grasp how VBA likes to talk. Perhaps members in the list might also like to suggest some favourite sources of general tips on coming to grips with excel syntax or perhaps good desk references of the VBA programming language. I have found the newsgroups and knowledge base give good detail on specific objects, methods etc... but I have yet to find any good instructions in the various groups and MVP websites on the basics of when to use various operators like () , : . = For example, connect objects with periods or enclose strings with quotes. Cheers Nick Flyger |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Basic Syntax
really no need to select most of the time, but here it is
Worksheets("data").Range("A24", Range("A24").End(xlDown)).Select -- Gary "Nick_F" wrote in message ups.com... I have recently begun learning programming in Excel after coming from a Matlab background. I find myself constantly running into syntax errors and other 'Bill Gates effects'. For example I use the macro recorder to produce the following simple proceedure... Sub selectrange() Sheets("Data").Select Range("A24").Select Range(Selection, Selection.End(xlDown)).Select End Sub That seems grossly inefficient and so I thought the following line would do the trick... Sub selectrange() Sheets("Data").("a24", "a24".End(xlDown)).Select End Sub but I get a compile error. Can anyone point out my problem, understanding that may help me to grasp how VBA likes to talk. Perhaps members in the list might also like to suggest some favourite sources of general tips on coming to grips with excel syntax or perhaps good desk references of the VBA programming language. I have found the newsgroups and knowledge base give good detail on specific objects, methods etc... but I have yet to find any good instructions in the various groups and MVP websites on the basics of when to use various operators like () , : . = For example, connect objects with periods or enclose strings with quotes. Cheers Nick Flyger |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
right syntax | Excel Worksheet Functions | |||
Basic question....syntax on active cells from a filter | Excel Programming | |||
Can I run Visual Basic procedure using Excel Visual Basic editor? | Excel Programming | |||
Help: Visual Basic Syntax | Excel Programming | |||
More Visual Basic Syntax | Excel Programming |