Guest_imported
New member
- Jan 1, 1970
- 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 <> ""
NumDepartement = Left(ActiveCell.Value, 2)
colonne = ClasseurRepresentants.Sheets(1).Range("A1:I50".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("A1".Select
ActiveCell.FormulaR1C1 = Initiales
ActiveCell.Offset(1, 1).Range("A1".Select
Wend
Set ClasseurRepresentants = Nothing
Workbooks("representants par departements.xls".Close
End Sub
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 <> ""
NumDepartement = Left(ActiveCell.Value, 2)
colonne = ClasseurRepresentants.Sheets(1).Range("A1:I50".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("A1".Select
ActiveCell.FormulaR1C1 = Initiales
ActiveCell.Offset(1, 1).Range("A1".Select
Wend
Set ClasseurRepresentants = Nothing
Workbooks("representants par departements.xls".Close
End Sub