Thread: Variable Macro
View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.misc
Heather O'Malley Heather O'Malley is offline
external usenet poster
 
Posts: 5
Default Variable Macro

I am trying to create a macro with a file name variable. The code I have
written doesn't seem to work, any ideas!

Dim ImportDir As String
Dim ImportFile As String

ImportDir = Range("a17").Value
ImportFile = Range("b17").Value

Windows("ImportFile").Activate
Sheets("Top 10 month").Select