Notifications
Clear all

Acrescentar $ em células lá arrastadas

16 Posts
4 Usuários
0 Reactions
2,719 Visualizações
(@rafalanz)
Posts: 34
Eminent Member
Topic starter
 

Bom dia,

Estou com a seguinte dúvida:

=SEERRO(SE(CW19<>"";SE(CY19+1>CW19;"";CY19+1);"");"")

Preciso arrastar o CW4 até para o CW3004 porém agora preciso arrastar desde o CW4:CW3004 para o lado >>>>, até o EC4:EC3004

Porém não queria ficar fixando de uma em uma para poder arrastar, até porque iria demorar muito tempo

Como faço para arrastar até embaixo mantendo o CW e arrastar tudo para o lado mantendo o 4:3004 ?

 
Postado : 30/10/2014 7:04 am
Fernando Fernandes
(@fernandofernandes)
Posts: 43750
Illustrious Member
 

Bom dia!

Eu utilizo esse código de autoria do MVP Andy Pope:

Sub MakeAbsoluteorRelativeSlow()

     'Written for www.ozgrid.com
     'By Andy Pope
     'www.andypope.info/
 
    Dim RdoRange As Range, rCell As Range
    Dim i As Integer
    Dim Reply As String
  
     'Ask whether Relative or Absolute
    Reply = InputBox("Change formulas to?" & Chr(13) & Chr(13) _
    & "Linha Relativa/Coluna Absoluta = 1" & Chr(13) _
    & "Linha Absoluta/Coluna Relativa = 2" & Chr(13) _
    & "Tudo Absoluto = 3" & Chr(13) _
    & "Tudo Relativo = 4", "OzGrid Business Applications")
  
     'They cancelled
    If Reply = "" Then Exit Sub
  
    On Error Resume Next
     
     'Set Range variable to formula cells only
    Set RdoRange = Selection.SpecialCells(Type:=xlFormulas)
   
     'determine the change type
    Select Case Reply
    Case 1 'Relative row/Absolute column


        For Each rCell In RdoRange
            If rCell.HasArray Then
                If Len(rCell.FormulaArray) < 255 Then
                    rCell.FormulaArray = _
                    Application.ConvertFormula _
                    (Formula:=rCell.FormulaArray, _
                    FromReferenceStyle:=xlA1, _
                    ToReferenceStyle:=xlA1, ToAbsolute:=xlRelRowAbsColumn)
                End If
            Else
                If Len(rCell.Formula) < 255 Then
                    rCell.Formula = _
                    Application.ConvertFormula _
                    (Formula:=rCell.Formula, _
                    FromReferenceStyle:=xlA1, _
                    ToReferenceStyle:=xlA1, ToAbsolute:=xlRelRowAbsColumn)
                End If
            End If
        Next rCell
       
    Case 2 'Absolute row/Relative column
        For Each rCell In RdoRange
            If rCell.HasArray Then
                If Len(rCell.FormulaArray) < 255 Then
                    rCell.FormulaArray = _
                    Application.ConvertFormula _
                    (Formula:=rCell.FormulaArray, _
                    FromReferenceStyle:=xlA1, _
                    ToReferenceStyle:=xlA1, ToAbsolute:=xlAbsRowRelColumn)
                End If
            Else
                If Len(rCell.Formula) < 255 Then
                    rCell.Formula = _
                    Application.ConvertFormula _
                    (Formula:=rCell.Formula, _
                    FromReferenceStyle:=xlA1, _
                    ToReferenceStyle:=xlA1, ToAbsolute:=xlAbsRowRelColumn)
                End If
            End If
        Next rCell
     
    Case 3 'Absolute all
        For Each rCell In RdoRange
            If rCell.HasArray Then
                If Len(rCell.FormulaArray) < 255 Then
                    rCell.FormulaArray = _
                    Application.ConvertFormula _
                    (Formula:=rCell.FormulaArray, _
                    FromReferenceStyle:=xlA1, _
                    ToReferenceStyle:=xlA1, ToAbsolute:=xlAbsolute)
                End If
            Else
                If Len(rCell.Formula) < 255 Then
                    rCell.Formula = _
                    Application.ConvertFormula _
                    (Formula:=rCell.Formula, _
                    FromReferenceStyle:=xlA1, _
                    ToReferenceStyle:=xlA1, ToAbsolute:=xlAbsolute)
                End If
            End If
        Next rCell
  
    Case 4 'Relative all
        For Each rCell In RdoRange
            If rCell.HasArray Then
                If Len(rCell.FormulaArray) < 255 Then
                    rCell.FormulaArray = _
                    Application.ConvertFormula _
                    (Formula:=rCell.FormulaArray, _
                    FromReferenceStyle:=xlA1, _
                    ToReferenceStyle:=xlA1, ToAbsolute:=xlRelative)
                End If
            Else
                If Len(rCell.Formula) < 255 Then
                    rCell.Formula = _
                    Application.ConvertFormula _
                    (Formula:=rCell.Formula, _
                    FromReferenceStyle:=xlA1, _
                    ToReferenceStyle:=xlA1, ToAbsolute:=xlRelative)
                End If
            End If
        Next rCell
     
    Case Else 'Typo
        MsgBox "Change type not recognised!", vbCritical, _
        "OzGrid Business Applications"
    End Select
    
     'Clear memory
    Set RdoRange = Nothing
End Sub

Doni

Existem mil maneiras de preparar Neston. Invente a sua!
http://www.youtube.com/ExpressoExcel

 
Postado : 02/11/2014 7:56 am
Página 2 / 2