Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Sub SetupPage(codePostal As String)
- On Error Resume Next
- bExisteFlle = Worksheets(codePostal).Name
- If Err.Number = 9 Then
- Err.Clear
- ActiveWorkbook.Worksheets.Add
- ActiveSheet.Name = codePostal
- ActiveSheet.Cells(1, 1) = "Annonce"
- ActiveSheet.Cells(1, 2) = "Surface"
- Columns("A:A").ColumnWidth = 10
- Columns("B:B").ColumnWidth = 7
- Rows("1:1").Font.Bold = True
- Else
- Worksheets(codePostal).Activate
- End If
- LastCol = ActiveSheet.UsedRange.Columns.Count
- If Not IsDate(Cells(1, LastCol)) Then
- LastCol = LastCol + 1
- ElseIf Day(Cells(1, LastCol)) <> Day(Now) Or Month(Cells(1, LastCol)) <> Month(Now) Then
- LastCol = LastCol + 1
- End If
- Cells(1, LastCol) = Now
- Cells(1, LastCol).NumberFormat = "dd/mm/yy"
- End Sub
- Sub AddLine(id As String, surface As String, price As String)
- LastCol = ActiveSheet.UsedRange.Columns.Count
- ShortId = Val(Split(id, "/")(2))
- For ligne = 2 To ActiveSheet.UsedRange.Rows.Count
- If Cells(ligne, 1) = ShortId Then
- Cells(ligne, LastCol) = price
- Cells(ligne, LastCol).NumberFormat = "#,##0 €"
- Exit Sub
- End If
- Next ligne
- ActiveSheet.Hyperlinks.Add Anchor:=Cells(ligne, 1), _
- Address:="http://www.seloger.com" & id, _
- TextToDisplay:=Str(ShortId)
- Cells(ligne, 2) = surface
- Cells(ligne, LastCol) = price
- Cells(ligne, LastCol).NumberFormat = "#,##0 €"
- End Sub
Advertisement
Add Comment
Please, Sign In to add comment