Quantcast
Channel: Active questions tagged excel - Stack Overflow
Viewing all articles
Browse latest Browse all 90244

"_" underscore in Excel Formula

$
0
0

I'm getting a problem, when I try to run these commands. Problem come from the formula expresion, since "_" is a syntax error, but I need exactly that formula in my Excel cells,

How could I solve it out?

Sub Prueba_Fernando()
Application.ScreenUpdating = False
Range("B:B").Columns.Insert
    Range("B1").FormulaLocal = "=EXTRAE(A1;HALLAR("_";A1;2)+1;LARGO(A1)-HALLAR("_";A1;1))"
        Set h1 = Sheets("Hoja1")
        h1.Range("B1").Copy
        For Each h In Sheets
        u = h.Range("A"& Rows.Count).End(xlUp).Row
        h1.Range("B2:B"& u).PasteSpecial xlAll
        Next
        MsgBox "Fórmulas aplicadas"

Dim xColIndex As Integer
Dim xRowIndex As Integer
xIndex = Application.ActiveCell.Column
xRowIndex = Application.ActiveSheet.Cells(Rows.Count, xIndex).End(xlUp).Row
Range(Cells(3, xIndex), Cells(xRowIndex, xIndex)).Copy
Application.ScreenUpdating = True
MsgBox "Información copiada a Portapapeles"

End Sub

Viewing all articles
Browse latest Browse all 90244

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>