0
I am Using VBA and I came up with an impasse: I can use a variable I created as a parameter to fill a spreadsheet?
I created an interactive Button and I am developing an algorithm that fills the table, follows below the code:
Private Sub CommandButton1_Click() 'Adicionar gasto
Dim data As String, nome As String, centro_custo As String, empresa As String, nf As String
Dim dat_pgto As String, recebimento As String
Dim iLinha As Integer, cont_contab As Integer, valor As Integer
iLinha = 3
data = InputBox("Digite a data de solicitação:")
MsgBox ("Data: " & data)
Do
iLinha = iLinha + 1
Loop Until Cells(iLinha, 1).Value = ""
ActiveCell.Formula(iLinha, A) = data
End Sub
From what I’ve seen, you’re hoping that at the end of a value range, he’ll put the date you entered, right? I also see incorrect use of . formula property, penultimate line. I recommend you change to Range("A" & iLinha) = date
– Paulo Vieira