我正在 Excel 中做一个十六进制到二进制的转换器。我在 Vba 中使用了 Vlookup,但它没有像我预期的那样工作,因为在单元格中我有“0000”,但该函数只写入了一个 0。我怎么解决这个问题?
Cells(8, 7) = Application.WorksheetFunction.VLookup(Range("G7"), Range("U6:V21"), 2)
您需要将单元格的格式更改为文本才能获得文本结果:
Cells(8, 7).NumberFormat = "@" 'text
Cells(8, 7) = Application.WorksheetFunction.VLookup(Range("G7"), Range("U6:V21"), 2)
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句