Ir para conteúdo
Fórum Script Brasil

rudinei soares

Membros
  • Total de itens

    1
  • Registro em

  • Última visita

Tudo que rudinei soares postou

  1. Bom dia senhores, parabéns pela ajuda em vários tópicos discutidos. Aproveitando a oportunidade, gostaria de pedir ajuda para uma problema que surgiu quando eu tentei disponibilizar minha planilha excel no Google Drive, sendo. Uma planilha com lista de dados e uma outra com Macros VBA. A Planilha com macro é possível selecionar uma ou mais palavras de uma coluna determinada, ex: Planilha de dados: A1 - Cidades, A2 - São Paulo, A3 - Santos, etc; População: B1 - 256666, B2 - 1884948, B3 - 65498, etc; Cep: C1 - 13045-200, C3 - 15052-002, C3 - 22052-100, etc; Planilha Listagem Completa: Cidades: A1= São Paulo, etc; Cep: C1= 15052-002, 22052-100; Eu usei o seguinte código: Private Sub Worksheet_Change(ByVal Target As Range) Worksheets("Listagem Completa").Unprotect "1234" Dim rngDV As Range Dim oldVal As String Dim newVal As String Dim lUsed As Long If Target.Count > 1 Then GoTo exitHandler On Error Resume Next Set rngDV = Cells.SpecialCells(xlCellTypeAllValidation) On Error GoTo exitHandler If rngDV Is Nothing Then GoTo exitHandler If Intersect(Target, rngDV) Is Nothing Then 'do nothing Else Application.EnableEvents = False newVal = Target.Value Application.Undo oldVal = Target.Value Target.Value = newVal If Target.Column = 25 _ Or Target.Column = 28 _ Or Target.Column = 30 _ Or Target.Column = 31 _ Or Target.Column = 32 _ Or Target.Column = 33 _ Or Target.Column = 34 Then If oldVal = "" Then 'do nothing Else If newVal = "" Then 'do nothing Else lUsed = InStr(1, oldVal, newVal) If lUsed > 0 Then If Right(oldVal, Len(newVal)) = newVal Then Target.Value = Left(oldVal, Len(oldVal) - Len(newVal) - 2) Else Target.Value = Replace(oldVal, newVal & ", ", "") End If Else Target.Value = oldVal _ & ", " & newVal End If End If End If End If End If exitHandler: Application.EnableEvents = True Worksheets("Listagem Completa").Protect "1234" End Sub Não sou programador, fiz isso com a ajuda de vocês, nos fóruns! Como poderiam me ajudar a transformar este código em javascript para o Google Drive? abraço e sucesso a todos!
×
×
  • Criar Novo...