How to pass variable to a Sub

  • Thread starter Thread starter alainB
  • Start date Start date
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
 
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
 

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