#1
|
|||
|
|||
as the return value of another column, using Listbox?
Hi
I have a listbox with 3 columns, I want to return the value from column 2 Code:
Private Sub CommandButton1_Click() Dim i, j, UltimaLinha As Integer Const FOR_READING = 1 Const FOR_WRITING = 2 Const FOR_APPENDING = 8 For i = 0 To ListBox1.ListCount - 1 If ListBox2.List(i) = True Then Sheets("Plan1").Activate 'Seleciona a planilha Banco Range("3:3").Select 'Seleciona a Linha 2 para inserção de nova linha Selection.Insert Shift:=xlDown 'Insere uma linha e coloca o banco para baixo Range("A1").Select 'Seleciona a primeira celula da base para inserção de dados ActiveCell.Value = Range("A2").Value + 1 ActiveCell.Offset(0, 1).Value = "GRAFICA E EDITORA REVENDA PRINT LTDA" ActiveCell.Offset(0, 2).Value = CDate(Now) ActiveCell.Offset(0, 6).Value = Val(ListBox2.List(i)) If datavencimento.Value = "" Then MsgBox "Data de Vencimento exigida!" Exit Sub Else: ActiveCell.Offset(0, 8).Value = CDate(datavencimento.Value) End If If dataenvio.Value = "" Then MsgBox "Data de Envio exigida!" Exit Sub Else ActiveCell.Offset(0, 13).Value = CDate(dataenvio.Value) End If ActiveCell.Offset(0, 9).Value = historico.Text ActiveCell.Offset(0, 10).Value = "ABERTA" ActiveCell.Offset(0, 11).Value = Val(ListBox2.List(i)) End If Next MsgBox "Lançamento realizado com sucesso!" End Sub |
#2
|
|||
|
|||
I'm Solved!
|
Thread Tools | |
Display Modes | |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
How to obtain the column “C” from column “A” and “B”? | Jamal NUMAN | Excel | 2 | 02-26-2012 01:28 PM |
Can I change the horizontal scrollbar to scroll smoothly rather than column by column | carpat | Excel | 0 | 01-10-2012 09:34 AM |
Need to search a column for a macth and return a result from a third column | pdfaust | Excel | 2 | 02-03-2011 03:02 PM |
Return to in box | cjwilson2740 | Outlook | 0 | 04-05-2010 02:27 PM |
Carriage Return Help | UCHelp | Word | 1 | 04-04-2010 10:11 PM |