View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Raja Raja is offline
external usenet poster
 
Posts: 70
Default procedure/function calling

hi
i am repeatedly using some stmts in the if like

If (StrComp(s,a) = 0 Then
Range("a" & j).Value = Sheets("sheet2").Range("a" & z).Value
Range("b" & j).Value = Sheets("sheet2").Range("h" & z).Value
end if
If (StrComp(s,b)= 0 Then
Range("a" & j).Value = Sheets("sheet2").Range("a" & z).Value
Range("b" & j).Value = Sheets("sheet2").Range("h" & z).Value
end if

here, i m often using the stmts(in red) often .
so can somebody help me how to use the procedures for (reusablitiy)
i want to pass the values j and z as arguments to the called procedure