Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Visible = false ??

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
0
0
Hi!

When I run the macro "Inserer_Initiales_Representants" (see below)

The file "Representants par departements.xls." appears for a fraction of a second.

my question is:
can I get the information from "Representants par departements.xls." with out the file showing up?

thanks,
"A beginner that tried many things"

Sub Inserer_Initiales_Representants()
Dim ClasseurRepresentants As Workbook
Dim NumDepartement As String
Dim colonne As Variant
Dim Initiales
Set ClasseurRepresentants = _
GetObject("c:\Representants par departements.xls.")
Range("D4").Select
While ActiveCell.Value <> &quot;&quot;
NumDepartement = Left(ActiveCell.Value, 2)
colonne = ClasseurRepresentants.Sheets(1).Range(&quot;A1:I50&quot;).Find _
(what:=NumDepartement, LookIn:=xlFormulas, lookat:=xlWhole).Address
colonne = Range(colonne).Column
colonne = CInt(colonne)
Initiales = ClasseurRepresentants.Sheets(1).Cells(3, colonne).Comment.Text
ActiveCell.Offset(0, -1).Range(&quot;A1&quot;).Select
ActiveCell.FormulaR1C1 = Initiales
ActiveCell.Offset(1, 1).Range(&quot;A1&quot;).Select
Wend
Set ClasseurRepresentants = Nothing
Workbooks(&quot;representants par departements.xls&quot;).Close
End Sub
 
Application.ScreenUpdating = False Thank you,
Dave Rattigan
 
Thanks! Ratman

Not only does this work but it also speeds up the Macro.

thanks again !I really appreciate
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top