cell.Offset(0, 1).Font.Color = RGB(255, 0, 0)
cell.Offset(0, 1).Font.Color = RGB(0, 255, 0)
If cell.Value <> "" Then
Public Function TakeFirstThreeReferences(inReference As String) As String
Dim tmpStrings() As String
TakeFirstThreeReferences = ""
tmpStrings = Split(inReference, ", ")
If UBound(tmpStrings) = 0 Then
TakeFirstThreeReferences = tmpStrings(0)
End If
If UBound(tmpStrings) = 1 Then
TakeFirstThreeReferences = tmpStrings(0) & ", " & vbCrLf & tmpStrings(1)
End If
If UBound(tmpStrings) >= 2 Then
TakeFirstThreeReferences = tmpStrings(0) & ", " & vbCrLf & tmpStrings(1) & ", " & vbCrLf & tmpStrings(2)
End If
End Function
Public Declare Function URLDownloadToFile Lib "urlmon" Alias _
"URLDownloadToFileA" (ByVal pCaller As Long, _
ByVal szURL As String, _
ByVal szFileName As String, _
ByVal dwReserved As Long, _
ByVal lpfnCB As Long) As Long
' http://site.ru/images/site/site_ru_logo.png
Sub Start()
Call DownloadToFile("http://site.ru/images/site/site_ru_logo.png", "D:\123.png")
End Sub
Public Sub DownloadToFile(url$, FileName$)
Dim lngRetVal&
lngRetVal = URLDownloadToFile(0, url, FileName, 0, 0)
If lngRetVal <> 0 Then
MsgBox "Error in DownloadToFile: Can't download from " & url & " to " & FileName
End If
End Sub
Private Sub TextBox1_Change()
Label1.Width = UserForm1.Width
Label1.Caption = TextBox1.Text
If Label1.Width > TextBox1.Width Then
Label1.Font.Size = Label1.Font.Size * (TextBox1.Width / Label1.Width / 1.1)
TextBox1.Font.Size = Label1.Font.Size
End If
End Sub
=INT(A1*24)+(A1*24-INT(A1*24))*60/100