valdemar21 Posted August 29, 2012 at 11:01 AM Report Share #473953 Posted August 29, 2012 at 11:01 AM Bom dia, Estou a iniciar-me na programação com VBA e estou com um problema que não consigo solucionar. Vou colocar aqui o que pretendo para ver se alguém pode ajudar. Deste já muito obrigado. Tenho os seguintes dados numa tabela Access: Evento Centro Valor 20004773 1060.8 DCCGA00 88.4 DGRRG00 88.4 DMRAM00 88.4 DMRPM02 176.8 DRHAD02 88.4 DSADM02 88.4 DSADM04 88.4 DSAIP04 88.4 DSCIC00 88.4 DSPSD00 176.8 20004774 1060.8 CGAB002 81.6 DOISC04 81.6 DOISR00 81.6 DRHAD02 163.2 DSACL02 163.2 DSASG00 81.6 DSPEA00 163.2 DSPRE00 244.8 O que pretendo é efetuar a cópia do campo Evento para as celulas seguintes até encontrar a proxima celula preenchida. Algo do género: Dim x as Integer lastRow = Cells(Cells.Rows.Count, "B").End(xlUp).Row For x = 1 To lastRow If Cells(x, "A").Value = Null Then Cells(x, "A").Value = Cells(x - 1, "A").Value Else Cells(x, "A").Value = Cells(x, "A").Value End If A questão é que em Excel estou a conseguir, mas quando tento em Access não consigo (as variaveis e definições devem ser diferentes) Obrigado, Link to comment Share on other sites More sharing options...
valdemar21 Posted August 29, 2012 at 01:58 PM Author Report Share #473974 Posted August 29, 2012 at 01:58 PM Tábela Access (peço desculpa mas não ficou bem anteriormente): Evento Centro Valor 2000075 1000 vázio AAAA 500 Vázio AAAB 250 Vázio AAAC 250 2000076 BBBB 1500 Vázio BBBC 500 Vázio BBBD 500 Vázio BBBE 500 ... Link to comment Share on other sites More sharing options...
acao Posted September 26, 2012 at 10:33 PM Report Share #476705 Posted September 26, 2012 at 10:33 PM boas amigo o problema ainda presiste? se afirmativo coloque o que tem desenvolvido para tentar ajudar. cumps acao Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now