声明变量范围以选择特定数据集

时间:2018-03-10 12:52:31

标签: excel-vba vba excel

我使用以下代码来选择变量范围。我的代码看起来像这样,但它以红色突出显示错误:编译错误预期列表分隔符或)。

Sub timestamp_upload()
Dim count4, dcount, dcount2 As Long
Dim user1 As String

user1 = Workbooks("Personal Billed Unbilled Tracker.xlsx").Worksheets("Billed Revenue").Range("L1").Value
count4 = ThisWorkbook.Worksheets("TimeStamp").Range("C1").Value


ActiveSheet.Range("E1").Select
ActiveCell.FormulaR1C1 = "=counta(C[-4]:C[-4])"
dcount = Workbooks("Time Stamp.xlsx").Worksheets("TimeStamp Data").Range("E1").Value

If dcount >= 1 Then
ThisWorkbook.Worksheets("TimeStamp").Activate
ThisWorkbook.Worksheets("TimeStamp").Range("A2:B" & count4).Select
Selection.Copy
Workbooks("Time Stamp.xlsx").Worksheets("TimeStamp Data").Activate
Workbooks("Time Stamp.xlsx").Worksheets("TimeStamp Data").Range("A" & dcount + 1).Select
Selection.PasteSpecial xlPasteValues
Application.CutCopyMode = False
Range("C" & dcount + 1).Select
dcount2 = Workbooks("Time Stamp.xlsx").Worksheets("TimeStamp Data").Range("E1").Value
**range("C & dcount+1:"C & dcount2").select**


End If
End Sub

请帮助。 **行的问题

0 个答案:

没有答案