Joksa

Untitled

Jun 9th, 2020
189
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. ----------------------------------------------------------------------------------
  2. PRETVARANJE SVIH 201 cifri u 0
  3. ---
  4. Sub Macro1()
  5.     Dim Cell As Range
  6.     Dim broj As Double
  7.  
  8.     Cells.Find(What:="201", After:=ActiveCell, LookIn:=xlFormulas, LookAt:= _
  9.         xlWhole, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:=False _
  10.         , SearchFormat:=False).Activate
  11.     For Each Cell In Cells
  12.         Range(ActiveCell.Offset(0, 1), ActiveCell.Offset(0, 1)).Select
  13.         If ActiveCell.Value = 0 Then
  14.             MsgBox "GOTOVO!"
  15.             Exit For
  16.         Else
  17.         ActiveCell.Value = 0
  18.         Cells.FindNext(After:=ActiveCell).Activate
  19.         End If
  20.     Next Cell
  21. End Sub
  22. ----------------------------------------------------------------------------------
  23. PRETVARANJE SVIH 201 cifri u iz 0 u adekvatne
  24. ---
  25. Sub Macro1()
  26.     Dim cell As Range
  27.     Dim Cifra As Integer
  28.    
  29.     Cells.Find(What:="201", After:=ActiveCell, LookIn:=xlFormulas, LookAt:= _
  30.         xlWhole, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:=False _
  31.         , SearchFormat:=False).Activate
  32.     For Each cell In Cells
  33.         Range(ActiveCell.Offset(0, 1), ActiveCell.Offset(0, 1)).Select
  34.         If ActiveCell.Value = 0 Then
  35.             ActiveCell.Formula = "=ROUND(" + Range(ActiveCell.Offset(-1, 0), ActiveCell.Offset(-1, 0)).AddressLocal() + "*0.115, 0)"
  36.             ActiveCell.Value = ActiveCell.Value
  37.             Range(ActiveCell.Offset(0, -1), ActiveCell.Offset(0, -1)).Select
  38.             Cells.FindNext(After:=ActiveCell).Activate
  39.         Else
  40.             MsgBox "GOTOVO!"
  41.             Exit For
  42.         End If
  43.     Next cell
  44. End Sub
Add Comment
Please, Sign In to add comment