Anda di halaman 1dari 5

22/07/13

Abril.com Revistas e sites

- VBA Excel - Manipulando as linhas e colunas Frum INFO - INFO Online


Grupo Abril Abril Mdia Distribuio Grfica Abril Educao Assine Loja SAC

Buscar na INFO

NOTCIAS

BLOGS

GAMES

REVIEWS

GADGETS

DOWNLOADS

Voc est em INFO Online Frum DESENVOLVIMENTO VBA

DICAS

FRUM

MULTIMDIA

TPICOS

DESENVOLVIMENTO

REVISTA

ASSINE

Pesquise no Frum
Busca Avanada

Buscar

No tem conta? Registrar

Nome de Usurio Entrar

VBA Excel - Manipulando as linhas e colunas


Postar uma resposta

Buscar este tpico


Alterar o tamanho da fonte Visualizar Impresso

Buscar

4 Mensagens Pgina 1 de 1 vba_bernardes Membro

VBA Excel - Manipulando as linhas e colunas


por v ba_bernardes 01 Dez 2012

VBA Excel - Manipulando as linhas e colunas


Status: Mensagens: 193 Registro: 18 Out 2012 Localizao: SANTOS - SP BRASIL Karma: [6] Website

J tive a oportunidade de disponibilizar aqui outros modos de como identificar qual a ltima linha (ou o ltimo registro) numa planilha de dados. Entre todas as tcnicas de VBA, esta uma das melhores. Para ser breve e suscinto, as outras tcnicas volta e meia eram falhas devido a dirty area . Depois de algum tempo alguns programadores acharam a melhor tcnica para identificarmos a ltima ocorrncia sem falhas. O exemplo abaixo uma variante da tcnica ensinada pelo Excel MVP, Bob Umlas. Testem naquelas bases de dados mais parrudas, com grandes quantidades de dados, acima de 100.000 linhas e vejam o excelente resultado. Cdigo: Selecionar tudo F u n c t i o nL C e l l ( w sA sW o r k s h e e t )A sR a n g e D i mL R o w & ,L C o l % O nE r r o rR e s u m eN e x t W i t hw s L e tL R o w &=. C e l l s . F i n d ( W h a t : = " * " ,S e a r c h D i r e c t i o n : = x l P r e v i o u s ,S e a r c h O r d e r : = x l B y R o w s ) . R o w L e tL C o l % =. C e l l s . F i n d ( W h a t : = " * " ,S e a r c h D i r e c t i o n : = x l P r e v i o u s , S e a r c h O r d e r : = x l B y C o l u m n s ) . C o l u m n E n dW i t h S e tL C e l l=w s . C e l l s ( L R o w & ,L C o l % ) E n dF u n c t i o n

Usando esta funo: A funo LCell demonstrada aqui no poder ser utilizada diretamente em uma planilha, mas poder ser evocada a partir de outro procedimento VBA. Implemente o cdigo como abaixo: Cdigo: Selecionar tudo S u bI d e n t i f i c a ( ) M s g B o xL C e l l ( S h e e t 1 ) . R o w E n dS u b

Outra contribuio interessante essa cuja a funo retorna diretamente o nmero da ltima linha, inclusive para uma clula de planilha, contribuio de Adilson Soledade neste Frum da Info, num tpico que iniciei: Cdigo: Selecionar tudo F u n c t i o nL R o w ( R e fA sR a n g e )A sI n t e g e r D i mw sA sW o r k s h e e t O nE r r o rR e s u m eN e x t S e tw s=R e f . P a r e n t L R o w=w s . C e l l s . F i n d ( W h a t : = " * " ,S e a r c h D i r e c t i o n : = x l P r e v i o u s ,S e a r c h O r d e r : = x l B y R o w s ) . R o w E n dF u n c t i o n

info.abril.com.br/forum/viewtopic.php?t=19694

1/5

22/07/13

- VBA Excel - Manipulando as linhas e colunas Frum INFO - INFO Online


Muitas e muitas vezes, vejo postado em diversos outros fruns ao redor da WEB, pessoas pedindo uma macro para excluir todas as linhas em branco ou todas as linhas duplicadas de uma srie de linhas em uma planilha. Aqui tem trs cdigos : Bernardes_DeleteBlankRows, Bernardes_DeleteRowOnCell , e Bernardes_DeleteDuplicateRows. Lembre-se, estas macros apagam linhas inteiras de sua planilha, no excluem clulas indiv iduais. Excluindo linhas em branco O cdigo Bernardes_DeleteBlankRows descrito a seguir ir apagar todas as linhas em branco na planilha especificada pela WorksheetName parmetro. Se este parmetro for omitido, a planilha ativa ser utilizada. O procedimento apagar as linhas que estiverem totalmente em branco ou contiverem clulas cujo o contedo seja apenas um nico apstrofe (caracter que controla a formatao). O procedimento exige a funo IsRowClear, mostrada aps o procedimento Bernardes_DeleteBlankRows. No apagar as linhas que contm frmulas, mesmo que a frmula retorne um valor vazio. A funo no excluir as linhas precedentes de uma frmula em uma clula se as linhas precedentes tiverem menor nmero de linhas que a linha. No entanto, se uma frmula referir-se a uma srie de linhas com nmeros mais altos do que as clulas que contm a frmula, e as linhas forem totalmente em branco, as linhas referenciadas pela frmula sero excludas. Portanto, a referncia da frmula pode ser alterada nas linhas acima da frmula excluda. Cdigo: Selecionar tudo S u bB e r n a r d e s _ D e l e t e B l a n k R o w s ( O p t i o n a lW o r k s h e e t N a m eA sV a r i a n t ) 'T h i sf u n c t i o nw i l ld e l e t ea l lb l a n kr o w so nt h ew o r k s h e e t 'n a m e db yW o r k s h e e t N a m e .T h i sw i l ld e l e t er o w st h a ta r e 'c o m p l e t e l yb l a n k( e v e r yc e l l=v b N u l l S t r i n g )o rt h a th a v e 'c e l l st h a tc o n t a i no n l ya na p o s t r o p h e( s p e c i a lT e x tc o n t r o l 'c h a r a c t e r ) . 'T h ec o d ew i l ll o o ka te a c hc e l lt h a tc o n t a i n saf o r m u l a , 't h e nl o o ka tt h ep r e c e d e n t so ft h a tf o r m u l a ,a n dw i l ln o t 'd e l e t er o w st h a ta r eap r e c e d e n tt oaf o r m u l a .T h i sw i l l 'p r e v e n td e l e t i n gp r e c e d e n t so faf o r m u l aw h e r et h o s e 'p r e c e d e n t sa r ei nl o w e rn u m b e r e dr o w st h a nt h ef o r m u l a '( e . g . ,f o r m u l ai nA 1 0r e f e r e n c e sA 1 : A 5 ) .I faf o r m u l a 'r e f e r e n c e sc e l lt h a ta r eb e l o w( h i g h e rr o wn u m b e r )t h e 'l a s tu s e dr o w( e . g ,f o r m u l ai nA 1 0r e f e r e n c eA 2 0 : A 3 0a n d 'l a s tu s e dr o wi sA 1 5 ) ,t h er e f e n c e si nt h ef o r m u l aw i l l 'b ec h a n g e dd u et ot h ed e l e t i o no fr o w sa b o v et h ef o r m u l a . D i mR e f C o l lA sC o l l e c t i o n D i mR o w N u mA sL o n g D i mP r e cA sR a n g e D i mR n gA sR a n g e D i mD e l e t e R a n g eA sR a n g e D i mL a s t R o wA sL o n g D i mF o r m u l a C e l l sA sR a n g e D i mT e s tA sL o n g D i mW SA sW o r k s h e e t D i mP r e c C e l lA sR a n g e I fI s M i s s i n g ( W o r k s h e e t N a m e )=T r u eT h e n S e tW S=A c t i v e S h e e t E l s e O nE r r o rR e s u m eN e x t S e tW S=A c t i v e W o r k b o o k . W o r k s h e e t s ( W o r k s h e e t N a m e ) I fE r r . N u m b e r< >0T h e n ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' 'I n v a l i dw o r k s h e e tn a m e . ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' E x i tS u b E n dI f E n dI f I fA p p l i c a t i o n . W o r k s h e e t F u n c t i o n . C o u n t A ( W S . U s e d R a n g e . C e l l s )=0T h e n ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' 'W o r k s h e e ti sb l a n k .G e tO u t . ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' E x i tS u b E n dI f 'F i n dt h el a s tu s e dc e l lo nt h e 'w o r k s h e e t . ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' S e tR n g=W S . C e l l s . F i n d ( w h a t : = " * " ,a f t e r : = W S . C e l l s ( W S . R o w s . C o u n t ,W S . C o l u m n s . C o u n t ) ,l o o k a t : = x l P a r t ,_ s e a r c h o r d e r : = x l B y C o l u m n s ,s e a r c h d i r e c t i o n : = x l P r e v i o u s ,M a t c h C a s e : = F a l s e ) L e tL a s t R o w=R n g . R o w S e tR e f C o l l=N e wC o l l e c t i o n ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' 'W eg of r o mb o t t o mt ot o pt ok e e p 't h er e f e r e n c e si n t a c t ,p r e v e n t i n g '# R E Fe r r o r s . ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' F o rR o w N u m=L a s t R o wT o1S t e p1 S e tF o r m u l a C e l l s=N o t h i n g I fA p p l i c a t i o n . W o r k s h e e t F u n c t i o n . C o u n t A ( W S . R o w s ( R o w N u m ) )=0T h e n ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' 'T h e r ea r en on o n b l a n kc e l l si n 'r o wR .S e ei fRi si nt h eR e f C o l l 'r e f e r e n c eC o l l e c t i o n .I fn o t , 'a d dr o wRt ot h eD e l e t e R a n g e . ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' O nE r r o rR e s u m eN e x t T e s t=R e f C o l l ( C S t r ( R o w N u m ) ) I fE r r . N u m b e r< >0T h e n ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' 'Ri sn o ti nt h eR e f C o l l 'c o l l e c t i o n .A d di tt o 't h eD e l e t e R a n g ev a r i a b l e . ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' I fD e l e t e R a n g eI sN o t h i n gT h e n S e tD e l e t e R a n g e=W S . R o w s ( R o w N u m ) E l s e S e tD e l e t e R a n g e=A p p l i c a t i o n . U n i o n ( D e l e t e R a n g e ,W S . R o w s ( R o w N u m ) ) E n dI f E l s e ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' 'Ri si nt h ec o l l e c t i o n . 'D on o t h i n g . ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' '

info.abril.com.br/forum/viewtopic.php?t=19694

2/5

22/07/13

- VBA Excel - Manipulando as linhas e colunas Frum INFO - INFO Online


E n dI f O nE r r o rG o T o0 E r r . C l e a r E l s e ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' 'C o u n t A>0 .F i n dt h ec e l l s 'c o n t a i n i n gf o r m u l a ,a n df o r 'e a c hc e l lw i t haf o r m u l a ,f i n d 'i t sp r e c e d e n t s .A d dt h er o wn u m b e r 'o fe a c hp r e c e d e n tt ot h eR e f C o l l 'c o l l e c t i o n . ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' I fI s R o w C l e a r ( R o w N u m : = R o w N u m )=T r u eT h e n ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' 'R o wc o n t a i n sn o t h i n gb u tb l a n k 'c e l l so rc e l l sw i t ho n l ya n 'a p o s t r o p h e .C e l l st h a tc o n t a i n 'o n l ya na p o s t r o p h ea r ec o u n t e d 'b yC o u n t A ,s ow eu s eI s R o w C l e a r 't ot e s tf o ro n l ya p o s t r o p h e s . 'T e s ti ft h i sr o wi si nt h e 'R e f C o l lc o l l e c t i o n .I fi ti s 'n o ti nt h ec o l l e c t i o n ,a d di t 't ot h eD e l e t e R a n g e . ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' O nE r r o rR e s u m eN e x t T e s t=R e f C o l l ( C S t r ( R o w N u m ) ) I fE r r . N u m b e r=0T h e n ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' 'R o we x i s t si nR e f C o l l .T h a tm e a n s 'af o r m u l ai sr e f e r e n c i n gt h i sr o w . 'D on o td e l e t et h er o w . ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' E l s e I fD e l e t e R a n g eI sN o t h i n gT h e n S e tD e l e t e R a n g e=W S . R o w s ( R o w N u m ) E l s e S e tD e l e t e R a n g e=A p p l i c a t i o n . U n i o n ( D e l e t e R a n g e ,W S . R o w s ( R o w N u m ) ) E n dI f E n dI f E l s e O nE r r o rR e s u m eN e x t S e tF o r m u l a C e l l s=N o t h i n g S e tF o r m u l a C e l l s=W S . R o w s ( R o w N u m ) . S p e c i a l C e l l s ( x l C e l l T y p e F o r m u l a s ) O nE r r o rG o T o0 I fF o r m u l a C e l l sI sN o t h i n gT h e n ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' 'N of o r m u l a sf o u n d .D o 'n o t h i n g . ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' E l s e ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' 'F o r m u l a sf o u n d .L o o pt h r o u g ht h ef o r m u l a 'c e l l s ,a n df o re a c hc e l l ,f i n di t sp r e c e d e n t s 'a n da d dt h er o wn u m b e ro fe a c hp r e c e d e n tc e l l 't ot h eR e f C o l lc o l l e c t i o n . ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' O nE r r o rR e s u m eN e x t F o rE a c hR n gI nF o r m u l a C e l l s . C e l l s F o rE a c hP r e cI nR n g . P r e c e d e n t s . C e l l s R e f C o l l . A d dI t e m : = P r e c . R o w ,k e y : = C S t r ( P r e c . R o w ) N e x tP r e c N e x tR n g O nE r r o rG o T o0 E n dI f E n dI f E n dI f ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' 'G ot ot h en e x tr o w , 'm o v i n gu p w a r d s . ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' N e x tR o w N u m ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' 'I fw eh a v er o w st od e l e t e ,d e l e t et h e m . ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' I fN o tD e l e t e R a n g eI sN o t h i n gT h e n D e l e t e R a n g e . E n t i r e R o w . D e l e t es h i f t : = x l S h i f t U p E n dI f E n dS u b F u n c t i o nI s R o w C l e a r ( R o w N u mA sL o n g )A sB o o l e a n ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' 'I s R o w C l e a r 'T h i sp r o c e d u r er e t u r n sT r u ei fa l lt h ec e l l s 'i nt h er o ws p e c i f i e db yR o w N u ma se m p t yo r 'c o n t a i n so n l ya" ' "c h a r a c t e r .I tr e t u r n sF a l s e 'i ft h er o wc o n t a i n so n l yd a t ao rf o r m u l a s . ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' D i mC o l N d xA sL o n g D i mR n gA sR a n g e C o l N d x=1 S e tR n g=C e l l s ( R o w N u m ,C o l N d x ) D oU n t i lC o l N d x=C o l u m n s . C o u n t I f( R n g . H a s F o r m u l a=T r u e )O r( R n g . V a l u e< >v b N u l l S t r i n g )T h e n I s R o w C l e a r=F a l s e E x i tF u n c t i o n E n dI f S e tR n g=C e l l s ( R o w N u m ,C o l N d x ) . E n d ( x l T o R i g h t ) C o l N d x=R n g . C o l u m n L o o p L e tI s R o w C l e a r=T r u e E n dF u n c t i o n

Este cdigo, Bernardes_DeleteBlankRows, excluir uma linha, se toda a linha estiver em branco. Apagar a linha inteira se uma clula na coluna especificada estiver em branco. Somente a coluna marcada, outras so ignoradas.

info.abril.com.br/forum/viewtopic.php?t=19694

3/5

22/07/13

- VBA Excel - Manipulando as linhas e colunas Frum INFO - INFO Online


Cdigo: Selecionar tudo P u b l i cS u bB e r n a r d e s _ D e l e t e R o w O n C e l l ( ) O nE r r o rR e s u m eN e x t S e l e c t i o n . S p e c i a l C e l l s( x l C e l l T y p e B l a n k s ) .E n t i r e R o w . D e l e t e A c t i v e S h e e t . U s e d R a n g e E n dS u b

Para usar este cdigo, selecione um intervalo de clulas por colunas e, em seguida, execute o cdigo. Se a clula na coluna estiver em branco, a linha inteira ser excluda. Para processar toda a coluna, clique no cabealho da coluna para selecionar a coluna inteira. Este cdigo eliminar as linhas duplicadas em um intervalo. Para usar, selecione uma coluna como intervalo de clulas, que compreende o intervalo de linhas duplicadas a serem excludas. Somente a coluna selecionada usada para comparao. Cdigo: Selecionar tudo S u bB e r n a r d e s _ D e l e t e D u p l i c a t e R o w sP b l i c a( ) ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' '' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' D e l e t e D u p l i c a t e R o w s " I s t oi r a p a g a rr e g i s t r o sd u p l i c a d o s ,c o mb a s en ac o l u n aa t i v a .O us e j a , " s eom e s m ov a l o re n c o n t r a d om a i sd eu m av e zn ac o l u n aa c t i v a ,m a st o d o s " o sp r i m e i r o s( l i n h an m e r om a i sb a i x o )s e r oe x c l u d o s . " ' P a r ae x e c u t a ram a c r o ,s e l e c i o n eac o l u n ai n t e i r aq u ev o c d e s e j ae s c a n e a r ' d u p l i c aee x e c u t a re s t ep r o c e d i m e n t o . ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' '' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' RD i mA sL o n g D i mNL o n g VV a r i a n tD i m D i mR n gG a m a O nE r r o rG o T oE n d M a c r o A p p l i c a t i o n . S c r e e n U p d a t i n g=F a l s e A p p l i c a t i o n . C a l c u l a t i o n=x l C a l c u l a t i o n M a n u a l S e tR n g=A p p l i c a t i o n . I n t e r s e c t( A c t i v e S h e e t . U s e d R a n g e ,_ A c t i v e S h e e t . C o l u m n s( A c t i v e C e l l . C o l u m n ) ) L e tA p p l i c a t i o n . S t a t u s B a r=" P r o c e s s a m e n t od eL i n h a : "&F o r m a t( R n g . R o w," # , # #0" ) L e tN=0 L e tR=R n g . R o w s . C o u n tT o2S t e p1 I FM o dR5 0 0=0T h e n L e tA p p l i c a t i o n . S t a t u s B a r=" L i n h ad ep r o c e s s a m e n t o : "&F o r m a t( R" ,##0" ) E n dI f ?=R n g . C e l l s( R ,1 ) .V a l o rV ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' '' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' N o t a" q u eC O U N T I Fo b r a se s t r a n h a m e n t ec o mu m av a r i a n t eq u ei g u a lav b N u l l S t r i n g . "A oi n v sd ep a s s a rn av a r i a n t e ,v o c p r e c i s ap a s s a rv b N u l l S t r i n ge x p l i c i t a m e n t e . ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' '' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' L e tV=v b N u l l S t r i n gE n t o L e tA p p l i c a t i o n . W o r k s h e e t F u n c t i o n .C O N T . S E( R n g . C o l u m n s( 1 ) ,v b N u l l S t r i n g ) >1E n t o R n g . R o w s( R ) .E n t i r e R o w . D e l e t e L e tN=N+1 E n dI f E l s e S eA p p l i c a t i o n . W o r k s h e e t F u n c t i o n . C o u n t I f( R n g . C o l u m n s( 1 ) ,V ) >1E n t o , ( R ) .R n g . R o w sE n t i r e R o w . D e l e t e L e tN=N+1 E n dI f E n dI f N e x tR E n d M a c r o : L e tA p p l i c a t i o n . S t a t u s B a r=F a l s e L e tA p p l i c a t i o n . S c r e e n U p d a t i n g=T r u e L e tA p p l i c a t i o n . C a l c u l a t i o n=x l C a l c u l a t i o n A u t o m a t i c M s g B o x" D u p l i c a rl i n h a se x c l u d a s : "&C S t r( N) E n dS u b

Tags: VBA, excel, dirty area, column, row, linha, coluna, delete

Andr Luiz Bernardes

http://inanyplace.blogspot.com/

Re: VBA Excel - Manipulando as linhas e colunas


por Guima 29 Dez 2012 Voltou com a palhaada, hein... no bastou ter seu outro user EXPULSO..... francamente... Sub Guilherme_Initialize() If Me.Guima <> "" Then MsgBox "Obrigado pela fora " Else MsgBox "Conto com sua colaborao " End If End Sub

Guima Iniciado

Status: Mensagens: 492 Registro: 06 Abr 2009 Karma: [22] vba_bernardes Membro

Re: VBA Excel - Manipulando as linhas e colunas


por v ba_bernardes 31 Dez 2012 Fica calmo colega!

Status:

info.abril.com.br/forum/viewtopic.php?t=19694

4/5

22/07/13
Mensagens: 193 Registro: 18 Out 2012 Localizao: SANTOS - SP BRASIL Karma: [6] Website

- VBA Excel - Manipulando as linhas e colunas Frum INFO - INFO Online


Esforce-se para contribuir com o frum e no em administr-lo. Deixe que as visitaes falem por si mesmas. Segue a minha Declarao sobre o assunto no ambiente correto Andr Luiz Bernardes

http://inanyplace.blogspot.com/ nelsoncamp Membro

Re: VBA Excel - Manipulando as linhas e colunas


por nelsoncamp 25 Fev 2013 Bom dia Peo imensa desculpa por incomodar se caso algo de errado esteja a fzer Mas preciso de uma ajuda urgente Estou a criar um formulrio no google drive onde cai as informaes numa folha de excel no google drive at aqui tudo bem Mas o que preciso que cada linha que seja acrescentada automaticamente fique numerada automaticamente... mas no fica e o que faz adicinar sempre uma linha completa H alguma forma de bloquear uma coluna para que ao cair a informao do formulrio no adicione clulas coluna em questo Obrigado Nelson Mostrar mensagens anteriores:

Status: Mensagens: 1 Registro: 25 Fev 2013 Karma: [0]

Todas as mensagens

Organizar por Postar uma resposta

Hora da Mensagem

Crescente

Ir

4 Mensagens Pgina 1 de 1 Retornar para VBA Ir para:

VBA
Quem est online

Ir

Usurios vendo este frum: Nenhum usurio registrado online e 12 visitantes PUBLICIDADE Pgina Principal A Equipe Remover cookies deste frum Horrio de Braslia Powered by phpBB 2000, 2002, 2005, 2007 phpBB Group Traduzido por phpBB Brasil

info.abril.com.br/forum/viewtopic.php?t=19694

5/5

Anda mungkin juga menyukai