Thread: VBA syntax
View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Arne Hegefors Arne Hegefors is offline
external usenet poster
 
Posts: 244
Default VBA syntax

Hello! I have become somewhat unsure of certian things regarding the syntax
in vba. therefor I would truly appreciate answers to the following questions:

1) In the beginning of a sub that takes two arguments do you have to write:
Private Sub checkReturnDifference(ByVal rng1 As Range, ByVal rng3 As Range)
or can you write ....(ByVal rng1, rng3 As Range)

2) When declaring new variables is it necessary to write:
Dim i As Integer
Dim k As Integer
.....
or is there a shorter way of doing this?

I know that these questions does not seem very important but when you have
meny variables then it does actually make a difference. thus, any help
appreciated! thank you all very much!