Advertisement
Guest User

Untitled

a guest
Jan 27th, 2020
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.57 KB | None | 0 0
  1. Dim fd As FileDialog
  2. Set fd = Application.FileDialog(msoFileDialogSaveAs)
  3. If fd.Show = -1 Then
  4. filename = fd.SelectedItems(1)
  5.  
  6. Open filename For Output As #1
  7. i = 0
  8. Do Until EOF(1)
  9. Line Input #1, x
  10.  
  11. y = Left(x, 1)
  12. z = Replace(x, y, UCase(y), 1, 1)
  13.  
  14.  
  15. For i = 1 To Len(x)
  16.  
  17. y = Mid(x, i, 1)
  18. If y = " " Then pos = i + 1
  19.  
  20.  
  21. Next i
  22. e = Mid(x, pos, 1)
  23. y = Replace(x, e, UCase(e), pos, 1)
  24.  
  25. answ = Left(z, pos - 1) & y
  26.  
  27. MsgBox ("Answer is: " & answ)
  28. Loop
  29. Print #1, answ
  30. Close #1
  31. End If
  32. Set fd = Nothing
  33. MsgBox ("The path is: " & filename)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement