Gabriel Macedo 0 Posted April 23, 2020 Report Share Posted April 23, 2020 Olá! Sou novo no VBA e necessito de ajuda. Preciso gerar datas e horas. A cada data, é necessário repeti-la 24 vezes, que é para equivaler às 24 horas do dia, Ex.: 23/04/2020 00:00, 23/04/2020 01:00,..., 23/04/2020 23:00. Grato pelo retorno. Quote Link to post Share on other sites
0 Alyson Ronnan Martins 0 Posted April 29, 2020 Report Share Posted April 29, 2020 Public Sub MostrarHoras() Dim dtCurrent As Double Dim hrAdd As Double dtCurrent = Sheets("Planilha1").Cells(1, "A").Value 'Iniciar o loop: For x = 0 To 23 Step 1 'Escrever na coluna C: Sheets("Planilha1").Cells(1 + x, "C").Value = dtCurrent + TimeValue(x & ":00:00") Next x End Sub Quote Link to post Share on other sites
Question
Gabriel Macedo 0
Olá! Sou novo no VBA e necessito de ajuda. Preciso gerar datas e horas. A cada data, é necessário repeti-la 24 vezes, que é para equivaler às 24 horas do dia, Ex.:
23/04/2020 00:00, 23/04/2020 01:00,..., 23/04/2020 23:00. Grato pelo retorno.
Link to post
Share on other sites
1 answer to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.