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

Converting VBA code to Google sheets app script [closed]

$
0
0

I have been using Excel VBA code since couple of months and it was working fine now i have to move this code to Google Sheets to access it from anywhere.

I am not an expert but i tried hard to convert this VBA code to Google App script but its still not working.

The code is very simple in VBA but difficult one is in Google Sheets for me. I was hoping to get some help for it.

Sheet

Option ExplicitPrivate Sub worksheet_Change(ByVal Target As Range)'Variables  On Error Resume Next  Dim dblWert As String  Dim strCellAdresse As String'Define the area to be evaluated    If Not Application.Intersect(Target, Range("E7:E32")) Is Nothing Then'Transfer cell address        strCellAdresse = Target.Address'Change column E to F.        strCellAdresse = Replace(strCellAdresse, "E", "F")'Remove dollar sign        strCellAdresse = Replace(strCellAdresse, "$", "")'Pass value to variable        dblWert = Range(strCellAdresse).Value'Format cell'Pass variable to cell        Range("D38").Value = Format(dblWert, "#,##0.00 €")    End IfEnd Sub

Google Sheet AppScript

function Toworkon() {var Exsheet = SpreadsheetApp.getActiveSpreadsheet().getSheetByName("Expiriment");var Exrange = Exsheet.getRange('E7:E32').getValues();//'Change column E to F.    Rngrplc = Replace(Exrange, "E", "F");//'Remove dollar sign    Rngrplc = Replace(Exrange, "$", "")// 'Format cell//        'Pass variable to cellvar cell = Exsheet.getRange("D38").getValues();cell.setNumberFormat("#,##0.00 €");}

Viewing all articles
Browse latest Browse all 9782

Trending Articles



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