Apagada docs

Aprendiendo a programar el pasado

Herramientas de usuario

Herramientas del sitio


es:basic:vba:excel_hexedit

excel_hexedit

Muestra un archivo en formato hex usando excel

Sub hexedit()
Dim book As Workbook
Dim sheet As Worksheet
Dim colname As String
Dim mibyte As Byte
 
Set book = Application.Workbooks.Add
Set sheet = book.Sheets.Add
sheet.Range("A:A").ColumnWidth = 12
sheet.Range("A1").Value = "Direccion"
sheet.Range("A1").HorizontalAlignment = xlHAlignCenter
For f = 1 To 16
    colname = Chr(Asc("A") + f)
    sheet.Range(colname + "1").Value = Hex(f - 1)
    colname = colname + ":" + colname
    sheet.Range(colname).ColumnWidth = 4
    sheet.Range(colname).HorizontalAlignment = xlHAlignCenter
Next f
 
Open Environ("UserProfile") + "\downloads\" + "GRAFICO.SEC" For Binary As #1
For f = 1 To LOF(1)
    Get 1, f, mibyte
    columna = Chr(Asc("B") + ((f - 1) Mod 16))
    fila = Int((f - 1) / 16) + 2
    sheet.Range(columna & fila).Value = Hex$((mibyte))
    If mibyte <> 13 And mibyte <> 15 Then
        sheet.Cells(fila, 18 + ((f - 1) Mod 16)).Value = ChrB(mibyte)
    End If
Next f
Close 1
 
End Sub
Este sitio web utiliza cookies. Al utilizar el sitio web, usted acepta almacenar cookies en su computadora. También reconoce que ha leído y entendido nuestra Política de privacidad. Si no está de acuerdo abandone el sitio web.Más información
es/basic/vba/excel_hexedit.txt · Última modificación: 2016/01/17 06:46 por nepenthes