Ir ao conteúdo
  • Cadastre-se

Marcio gomes dos santos

Membro Júnior
  • Posts

    3
  • Cadastrado em

  • Última visita

Reputação

3
  1. Fiz este codigo para quando eu salvar ele me gere na planilha uma numeração a partir do (1), porém ele inicia (1009). Como faço para corrigir este erro? Private Sub Button_Salvar_Click() Dim OS As Integer Ordem.Cells(1, "u").Value = Ordem.Cells(1, "u").Value + 1 OS = Ordem.Cells(1, "u").Value With Ordens_Servico ' i = Ordens_Servico.UsedRange.Rows.Count + 1 Ordens_Servico.Cells(U, 1).Value = U Ordens_Servico.Cells(U, 2).Value = OS Ordens_Servico.Cells(U, 3).Value = Me.Combo_TAG.Text Ordens_Servico.Cells(U, 4).Value = Me.Text_Desc_Eqto.Text Ordens_Servico.Cells(U, 5).Value = Me.Text_Tipo_Eqto.Text Ordens_Servico.Cells(U, 6).Value = Me.Text_Servico_A_Realizar.Text Ordens_Servico.Cells(U, 8).Value = Me.Combo_Tipo_S.Value Ordens_Servico.Cells(U, 21) = "=DAY(RC[-12])" Ordens_Servico.Cells(U, 22) = "=MONTH(RC[-13])" Ordens_Servico.Cells(U, 23) = "=YEAR(RC[-14])" End With MsgBox "Ordem Emitida com Sucesso!" & Chr(13) & "Ordem Nº " & "(" & OS & ")", vbInformation, "ExcelPratic" Button_Print.Enabled = True End Sub
  2. Estou com este codigo no meu vba excel. não sei o que fiz de errado, pois quando salvo um produto ele gera uma numeração alta na planilha. Ele teria que salvar a partir do numero (1)e esta salvando a partir do (1109). codigo a baixo. MsgBox "Ordem Emitida com Sucesso!" & Chr(13) & "Ordem Nº " & "(" & OS & ")", vbInformation, "ExcelPratic" Button_Print.Enabled = True Quem puder ajudar eu agradeço. abaixo o código completo.. Private Sub Button_Salvar_Click() Dim OS As Integer Ordem.Cells(1, "u").Value = Ordem.Cells(1, "u").Value + 1 OS = Ordem.Cells(1, "u").Value With Ordens_Servico ' i = Ordens_Servico.UsedRange.Rows.Count + 1 Ordens_Servico.Cells(U, 1).Value = U Ordens_Servico.Cells(U, 2).Value = OS Ordens_Servico.Cells(U, 3).Value = Me.Combo_TAG.Text Ordens_Servico.Cells(U, 4).Value = Me.Text_Desc_Eqto.Text Ordens_Servico.Cells(U, 5).Value = Me.Text_Tipo_Eqto.Text Ordens_Servico.Cells(U, 6).Value = Me.Text_Servico_A_Realizar.Text Ordens_Servico.Cells(U, 8).Value = Me.Combo_Tipo_S.Value Ordens_Servico.Cells(U, 21) = "=DAY(RC[-12])" Ordens_Servico.Cells(U, 22) = "=MONTH(RC[-13])" Ordens_Servico.Cells(U, 23) = "=YEAR(RC[-14])" End With MsgBox "Ordem Emitida com Sucesso!" & Chr(13) & "Ordem Nº " & "(" & OS & ")", vbInformation, "ExcelPratic" Button_Print.Enabled = True End Sub

Sobre o Clube do Hardware

No ar desde 1996, o Clube do Hardware é uma das maiores, mais antigas e mais respeitadas comunidades sobre tecnologia do Brasil. Leia mais

Direitos autorais

Não permitimos a cópia ou reprodução do conteúdo do nosso site, fórum, newsletters e redes sociais, mesmo citando-se a fonte. Leia mais

×
×
  • Criar novo...