Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 03-27-2012, 11:13 AM
marreco marreco is offline as the return value of another column, using Listbox? Windows XP as the return value of another column, using Listbox? Office 2007
Novice
as the return value of another column, using Listbox?
 
Join Date: Mar 2012
Posts: 8
marreco is on a distinguished road
Default 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

Reply With Quote
  #2  
Old 03-27-2012, 12:48 PM
marreco marreco is offline as the return value of another column, using Listbox? Windows XP as the return value of another column, using Listbox? Office 2007
Novice
as the return value of another column, using Listbox?
 
Join Date: Mar 2012
Posts: 8
marreco is on a distinguished road
Default

I'm Solved!
Reply With Quote
Reply

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
as the return value of another column, using Listbox? 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

Other Forums: Access Forums

All times are GMT -7. The time now is 04:23 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2021, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2021 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft