0
votes

I have this formula for an Excel worksheet I use to track appointments. It works great but now I need to share it real-time with other members of my organization so I uploaded the workbook to Google sheets but of course, the formula doesn't translate (work).

How can I adjust the formula below to work in Google sheets?

Private Sub Worksheet_Change(ByVal Target As Range)

Dim AddRange As Range

Set AddRange = Range("C4:C100") '' Your add appointment range

If Not Intersect(Target, AddRange) Is Nothing Then

If Target.Value <> "Add Appointment" Then

        Exit Sub

Else

        Range("B" & Target.Row).Value = Range("B" & Target.Row).Value + 1

End If

End If

End Sub

Thank you in advance for your time and effort.

1

1 Answers

0
votes

Hi it would be more clear if you added a sheet with data and what you exactly want, but with my basic understanding of question this should help i think.

function ifFunction() {
  var spreadSheet = SpreadsheetApp.getActiveSpreadsheet().getActiveSheet();
  // Put your range below between ("") of input 
  var workingRange = spreadSheet.getRange("");

  // if(workingRange = here should be your criteria)
  if (workingRange = ) {
    spreadSheet.getRange("C1:C100").setValue("Add Appointment");
  } else { 
  // Put your formula below in .setValue
    spreadSheet.getRange("C1:C100").setValue("");
  }
}

Make necessary changes below the comments.