Quantcast
Channel: Hot Weekly Questions - Web Applications Stack Exchange
Viewing all articles
Browse latest Browse all 9712

Converting this VBA code to Google Script

$
0
0

EDIT: I'm going to drop a link to where I asked this question in a different place, The code below doesn't seem to be visually pleasing. You'll probably want to skip to the 2nd post.

https://support.google.com/docs/thread/60504437?hl=en

So I have a Excel spreadsheet that I'm trying to convert to Google Sheets however I don't know how to convert the VBA code below to Google Script, If anyone can point me in the right direction that would be great.

Sub CopySource()Application.Calculation = xlCalculationManualApplication.ScreenUpdating = FalseApplication.DisplayStatusBar = FalseApplication.EnableEvents = FalseIf Range("L6").Value = "Pending" ThenMsgBox "Result still set as 'Pending'. You absolute donut."ElseDim rngSource As RangeDim rngTarget As RangeDim iRow As Integer

iRow = Worksheets("Records").Cells(Rows.Count, 1).End(xlUp).Row + 1Worksheets("Inputs").Range("A6:M6").CopyWorksheets("Records").Range("A" & iRow).PasteSpecial Paste:=xlPasteValuesSheets("Inputs").Range("B6:G6").ClearContentsRange("J6").FormulaR1C1 = "0"Range("L6").FormulaR1C1 = "Pending"End If

Application.EnableEvents = TrueApplication.DisplayStatusBar = TrueApplication.ScreenUpdating = TrueApplication.Calculation = xlCalculationAutomatic

End Sub


Viewing all articles
Browse latest Browse all 9712

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>