Prev: adsa
Next: emailing multiple reports
From: M Chahal on 8 Mar 2010 05:07 Hi, Please see code below..... Sub X1() V1 = "GI-ACE" Sheets(V1).Select Call S End Sub Sub S() ActiveSheet.UnProtect ("util") Range("B43:BW200").Select Selection.ClearContents Sheets("Data").Select Selection.AutoFilter Field:=1, Criteria1:=V1 '!!!!THIS IS WHERE IT FAILS!!!!' Selection.AutoFilter Field:=145, Criteria1:="CHECK" Range("E3:G800").Select Selection.Copy Sheets(V1).Select '!!!!THIS IS WHERE IT FAILS!!!!' Range(B42).Select Selection.PasteSpecial Paste:=xlPasteValues End Sub Basically, I need to use a defined variable (V1) in other subs, how can I do that without stating it in each sub?? Any help appreciated. MSC
From: Stefan Hoffmann on 8 Mar 2010 05:20 hi, On 08.03.2010 11:07, M Chahal wrote: > Basically, I need to use a defined variable (V1) in other subs, how can I do > that without stating it in each sub?? You already got some answers. Have you read them? mfG --> stefan <--
From: De Jager on 13 Mar 2010 12:41 "M Chahal" <MChahal(a)discussions.microsoft.com> wrote in message news:AA96FFB1-7B3F-4EE4-AB3F-75156D5A1191(a)microsoft.com... > Hi, > > Please see code below..... > Sub X1() > V1 = "GI-ACE" > Sheets(V1).Select > Call S > End Sub > > Sub S() > ActiveSheet.UnProtect ("util") > Range("B43:BW200").Select > Selection.ClearContents > Sheets("Data").Select > Selection.AutoFilter Field:=1, Criteria1:=V1 '!!!!THIS IS WHERE IT > FAILS!!!!' > Selection.AutoFilter Field:=145, Criteria1:="CHECK" > Range("E3:G800").Select > Selection.Copy > Sheets(V1).Select '!!!!THIS IS WHERE IT FAILS!!!!' > Range(B42).Select > Selection.PasteSpecial Paste:=xlPasteValues > End Sub > > Basically, I need to use a defined variable (V1) in other subs, how can I > do > that without stating it in each sub?? > > Any help appreciated. > > MSC
From: joelgeraldine on 17 Mar 2010 09:48 kjjkjkj "M Chahal" <MChahal(a)discussions.microsoft.com> a écrit dans le message de groupe de discussion : AA96FFB1-7B3F-4EE4-AB3F-75156D5A1191(a)microsoft.com... > Hi, > > Please see code below..... > Sub X1() > V1 = "GI-ACE" > Sheets(V1).Select > Call S > End Sub > > Sub S() > ActiveSheet.UnProtect ("util") > Range("B43:BW200").Select > Selection.ClearContents > Sheets("Data").Select > Selection.AutoFilter Field:=1, Criteria1:=V1 '!!!!THIS IS WHERE IT > FAILS!!!!' > Selection.AutoFilter Field:=145, Criteria1:="CHECK" > Range("E3:G800").Select > Selection.Copy > Sheets(V1).Select '!!!!THIS IS WHERE IT FAILS!!!!' > Range(B42).Select > Selection.PasteSpecial Paste:=xlPasteValues > End Sub > > Basically, I need to use a defined variable (V1) in other subs, how can I > do > that without stating it in each sub?? > > Any help appreciated. > > MSC
From: R. Heine on 8 Apr 2010 05:29
"M Chahal" <MChahal(a)discussions.microsoft.com> schrieb im Newsbeitrag news:AA96FFB1-7B3F-4EE4-AB3F-75156D5A1191(a)microsoft.com... > Hi, > > Please see code below..... > Sub X1() > V1 = "GI-ACE" > Sheets(V1).Select > Call S > End Sub > > Sub S() > ActiveSheet.UnProtect ("util") > Range("B43:BW200").Select > Selection.ClearContents > Sheets("Data").Select > Selection.AutoFilter Field:=1, Criteria1:=V1 '!!!!THIS IS WHERE IT > FAILS!!!!' > Selection.AutoFilter Field:=145, Criteria1:="CHECK" > Range("E3:G800").Select > Selection.Copy > Sheets(V1).Select '!!!!THIS IS WHERE IT FAILS!!!!' > Range(B42).Select > Selection.PasteSpecial Paste:=xlPasteValues > End Sub > > Basically, I need to use a defined variable (V1) in other subs, how can I > do > that without stating it in each sub?? > > Any help appreciated. > > MSC |