function in VBA - automatical usage question

  • Thread starter Thread starter Marcin Zmyslowski
  • Start date Start date
M

Marcin Zmyslowski

I have created a function in Visual Basic which have such a structure

public function function_count_working_hours(worksheetname as string;
parameter1 as string; parameter2 as integer) as string

I have a problem with parameter2. I have a lot of cells where I have to put
it, but in each cell I have to put another
number. I couldn`t fill in series in where this paramater2 will have values:
1, 2, 3, 4, 5 depending on number of cell.
for example:
Column1
----------------------
AA1
AA2
AA3

that is:

Column1
---------------------------------------------------------
function_count_working_hours("03.2004";"C";1)
function_count_working_hours("03.2004";"C";2)
function_count_working_hours("03.2004";"C";3)
and so on

How to fill in this parameter2 to make it growing automaticaly?

Thankx a lot
Marcin
 
Hi
try something like
function_count_working_hours("03.2004";"C";ROW())
and copy down
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top