I gang

macro to goole script -- 2

Hi, i want attached macro code, converted to google script code. Should be easy to do. And please bid only if i can manage it for the bidding price. thanks. The macro code is:

Attribute VB_Name = "Module1"

Sub CreateTable()

Attribute CreateTable.VB_ProcData.VB_Invoke_Func = "P\n14"

If Range("a1") <> "Group No." And Range("b1") <> "Entry Type" Then

MsgBox "Please select the data sheet before running the macro."

Exit Sub

End If

Dim mainWS As Worksheet

Dim datemin, datemax, currdate As Date

Dim kserv, lunch1, lunch2, totlunch, dinner As Long

Dim lastrow As Long

lastrow = Range("a1").End(xlDown).Row

Set mainWS = ActiveSheet

datemin = [url removed, login to view](Range("F:F"))

datemax = [url removed, login to view](Range("F:F"))

[url removed, login to view] = False

On Error Resume Next

Sheets("output").Delete

[url removed, login to view] = True

[url removed, login to view] = "Output"

Range("a1") = "Date"

Range("a2") = "KK Serv."

Range("a3") = "Lunch 1"

Range("a4") = "Lunch 2"

Range("a5") = "[url removed, login to view]"

Range("a6") = "Dinner"

i = 2

For datemin = datemin To datemax

Cells(1, i) = datemin

i = i + 1

Next

j = 2

For i = 2 To Range("a1").End(xlToRight).Column

currdate = Cells(1, i)

j = 2

Do While [url removed, login to view](j, 1) <> ""

If [url removed, login to view](j, 6) = currdate Then

If [url removed, login to view](j, 3) = 549 Or [url removed, login to view](j, 3) = 550 Then

kserv = kserv + [url removed, login to view](j, 9)

ElseIf [url removed, login to view](j, 3) > 709 And [url removed, login to view](j, 3) < 730 And [url removed, login to view](j, 7) > TimeSerial(9, 59, 59) And [url removed, login to view](j, 7) < TimeSerial(12, 15, 1) Then

lunch1 = lunch1 + [url removed, login to view](j, 9)

ElseIf [url removed, login to view](j, 3) > 709 And [url removed, login to view](j, 3) < 730 And [url removed, login to view](j, 7) > TimeSerial(12, 15, 59) And [url removed, login to view](j, 7) < TimeSerial(16, 0, 1) Then

lunch2 = lunch2 + [url removed, login to view](j, 9)

ElseIf [url removed, login to view](j, 3) > 829 And [url removed, login to view](j, 3) < 896 Then

dinner = dinner + [url removed, login to view](j, 9)

End If

End If

j = j + 1

Loop

Cells(2, i) = kserv

Cells(3, i) = lunch1

Cells(4, i) = lunch2

Cells(5, i) = lunch1 + lunch2

Cells(6, i) = dinner

kserv = 0

lunch1 = 0

lunch2 = 0

dinner = 0

Next

Range("b1:ba1").NumberFormat = "dd/mm/yyyy"

Range("b1:ba1").[url removed, login to view] = True

Range("a1").[url removed, login to view](xlEdgeBottom).LineStyle = xlContinuous

Range("a1").[url removed, login to view](xlEdgeTop).LineStyle = xlContinuous

Range("a1").[url removed, login to view](xlEdgeLeft).LineStyle = xlContinuous

Range("a1").[url removed, login to view](xlEdgeRight).LineStyle = xlContinuous

Range("a1").[url removed, login to view](xlInsideHorizontal).LineStyle = xlContinuous

Range("a1").[url removed, login to view](xlInsideVertical).LineStyle = xlContinuous

Range(Cells(2, 1), Cells(6, Range("a1").End(xlToRight).Column)).[url removed, login to view] = vbYellow

End Sub

Evner: Excel Macros, Javascript

Se mere: google sheets macro button, google sheets macro language, google sheets record macro, google sheets custom functions, google sheets script examples, convert vba to google script, excel macros in google sheets, google sheets button to run script, excel macro java script, macro excel script, macro builder script, email macro outlook script, call macro vbs script outlook, script php cpanel add domain, macro update script

Om arbejdsgiveren:
( 5 bedømmelser ) oslo, Norway

Projekt ID: #15181274

2 freelancere byder i gennemsnit $30 på dette job

$35 USD på 1 dag
(1 bedømmelse)
0.9
$25 USD på 1 dag
(0 bedømmelser)
0.0