将公式转换为文本

时间:2016-02-16 07:04:23

标签: vba excel-vba excel

我的VBA代码如下:

Dim rng1 As range, _
    i As Long, _
    col1 As String, _
    col2 As String, _
    col3 As String, _
    count1 As Integer, _
    count2 As Integer, _
    count3 As Integer

    col1 = Sheet4.range("D7").Value
    col2 = Sheet4.range("D9").Value
    col3 = "A"
    count3 = 2

    For i = 3 To 13299
    Set rng1 = Sheet2.range(col1 & i)
        If Sheet3.range(col2 & i) = Sheet2.range(col1 & i) Or _
            Sheet3.range(col2 & i).Value = "NULL" And Sheet2.range(col1 & i) = "" Then
            Sheet4.range("B" & i).Value = "Match"
            count1 = count1 + 1

            ElseIf Sheet3.range(col2 & i).Application.WorksheetFunction.IsText = False _
            And Sheet2.range(col1 & i).Application.WorksheetFunction.IsText = False Then
            ---Insert here

            Else

我应该在“插入此处”部分中将代码转换为文本?

1 个答案:

答案 0 :(得分:0)

我不确定你想要转换为某个值的位置,但是说你正在尝试将A1中的任何内容转换为可以使用的值:

Range("A1").Value = Range("A1").Value