Home |
Search |
Today's Posts |
#12
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Try then following.
-Merjet Sub InsertRepresentativesInitials() Dim ClasseurRep As Workbook Dim Numdpt As String Dim Colonne As Variant Dim c As Range Dim iEnd As Long Set ClasseurRep = Workbooks.Open("C:\TPExcel\Representants.xls") On Error Resume Next iEnd = ThisWorkbook.Sheets("Feuil1").Range("D4").End(xlDo wn).Row For Each c In ThisWorkbook.Sheets("Feuil1").Range("D4:D" & iEnd) Numdpt = Left(c.Value, 2) Colonne = "" Colonne = ClasseurRep.Sheets(1).Range("A4:F20").Find(What:=N umdpt, _ LookIn:=xlFormulas, LookAt:=xlWhole).Address If Colonne < "" Then Colonne = CInt(Range(Colonne).Column) c.Offset(0, -1) = ClasseurRep.Sheets(1).Cells(3, Colonne).Comment.Text End If Next c ClasseurRep.Close Set ClasseurRep = Nothing End Sub |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Newbie he I have a question about a print macro I am trying to write... | Excel Programming | |||
Newbie questions - probably simple | Excel Programming | |||
I want to write a book on my computer.How can I type? | New Users to Excel | |||
How do I get a Template to write a Book ? | New Users to Excel | |||
IF then write new worksheet/book | Excel Programming |