PerfectEye / VBA_makros

Makros used with my excel sheets
0 stars 0 forks source link

rozksięgowanie kosztów #9

Open PerfectEye opened 6 years ago

PerfectEye commented 6 years ago

Option Explicit

Sub koszts() ' ' koszts Makro '

' Dim sht As Worksheet Dim LastRow As Long Set sht = ActiveSheet LastRow = sht.cells.Find("*", SearchOrder:=xlByRows, SearchDirection:=xlPrevious).Row

Range("B1").Select
ActiveCell.FormulaR1C1 = "=LEFT(RC[-1],SEARCH(""["",RC[-1])-1)"
 Range("C1").Select
ActiveCell.FormulaR1C1 = "=RIGHT(RC[-2],LEN(RC[-2])-SEARCH(""["",RC[-2])+1)"
Range("B1:C1").Select
Selection.Copy
Range("B1:C" & LastRow).Select
ActiveSheet.Paste

End Sub