我有多种格式的数据,并且我努力改变它们以尝试找到它们。所讨论的数字目前以dataT.Range("F2:F" & lRow).NumberFormat = "###.00"
的格式存储为数字。但是,它们存储在另一个电子表格的其他地方,其格式为####,不包括小数。这样的例子将是原始格式:“30.00”新格式“3000”或原始格式:“10.50”新格式“1050”。我试图通过Replace()
函数删除小数,但我相当肯定它会失败,它确实如此。任何想法或建议将不胜感激。这个功能是一个更大程序中非常小的一部分。发现不同格式的长文字
问题简单地说:我需要改变以这种格式存储“30.00”目标格式“3000”与开始行权是一个数字,我试图解决这个问题
Function AnalyzeOiData(lRow As Integer, oiDataSheet As Worksheet, productSheet As Worksheet, rownum As Integer)
Dim counter As Integer
Dim monthExp As String
Dim oiLocationFinder As Range
Dim strikeLoc As Range
Dim optStrike As Long
For counter = rownum To lRow
'Returns formatted monthcode for finding the different months of expiry embedded in the OI data
monthExp = GetMonthCode(productSheet.Cells(counter, 1), productSheet.Cells(counter, 2))
optStrike = Replace(productSheet.Cells(counter, 3), ".", "") ***
oiLocationFinder = oiDataSheet.Columns(1).Find(monthExp)
oiLocationFinder.Select
strikeLoc = Range(Selection, Selection.End(xlDown)).Find(optStrike).Address
productSheet.Cells(counter, 11) = strikeLoc.Offset(0, 9)
productSheet.Cells(counter, 12) = strikeLoc.Offset(0, 10)
Next
End Function
'10.50 * 100 = 1050'? –
请修复您的文章中的代码的格式,谢谢:) – Archimaredes
刚刚去做,斯科特做到了。当我复制它时,它会被抛弃。 – StormsEdge