ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Why "expected function" on such basic VB? (https://www.excelbanter.com/excel-programming/372962-why-expected-function-such-basic-vbulletin.html)

Darin Kramer

Why "expected function" on such basic VB?
 
Howdie,

Why do I get error "expected function"with this simple vb..?

Sheets("abc").Select
Cells.Select
selection.Clear

Thanks

D

*** Sent via Developersdex http://www.developersdex.com ***

Snake Plissken[_2_]

Why "expected function" on such basic VB?
 
perhaps during compilation of ur code a function is expected in any other
place ? Do you use option explicit directive and you compiled manually ur
code before u run the macro ?



Darin Kramer

Why "expected function" on such basic VB?
 


Thanks, I worked it out!

*** Sent via Developersdex http://www.developersdex.com ***

Harald Staff

Why "expected function" on such basic VB?
 
Hi

Adding, don't select and activate, it is unnecessary and slow in at least
99% of the cases. Just write

Sheets("abc").Cells.Clear

it runs invisible and fast, and your working environment doesn't change.

HTH. Best wishes Harald

"Darin Kramer" skrev i melding
...


Thanks, I worked it out!

*** Sent via Developersdex http://www.developersdex.com ***





All times are GMT +1. The time now is 09:17 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com