Tri*_*max 5 excel formatting vba vlookup
我有一张包含混合格式数据(日期、双精度、字符串等)的工作表。我在lookup_range中搜索值(my_index),并且我想检索数据以更改其他工作表中的单元格。它工作正常,但是当 VLookup 返回的值是日期并且我将其设置到另一张表时,它会丢失其日期格式。
Dim lookup_range As Range
Dim my_index, my_value As Variant
my_value = Application.VLookup(my_index, lookup_range, num_col, False)
Sheets(3).Cells(num_row, last_col_s1 + num_col - 1).Value = my_value
Run Code Online (Sandbox Code Playgroud)
因此,当lookup_range中的数据是02/05/2014sheet-3中显示的数据时,看起来像41761。
我需要保留lookup_range中数据的原始数据格式。