How to pass variable to a Sub

A

alainB

Hi,

Private Sub Worksheet_activate()
Dim X
X = Sheets("DATA").UsedRange.Rows.Count
Application.Run "WhatEver"
End Sub

I would like to pass the value of X to WhatEver Sub.

How can I do that?

Thanks,


Alai
 
C

Chip Pearson

Alain,

You can pass variables directly in the Run method. E.g.,

Application.Run "WhatEver", X


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com
 
Top