VBA Getting data from another Sheet

二次信任 提交于 2020-06-28 10:53:53

问题


Currently i am trying to get data from another sheet, on the current sheet a user types dates they want to get. I am getting a syntax error though, when i try to get the data. This is my code.

Private Sub CommandButton1_Click()

Dim Fund As String, Start, EndD As Date


Fund = Range("B4")
Start = Range("B5")
EndD = Range("B6")
Dim rngS As Range
Dim rngE As Range

   Set rngS = Sheets("Sheet1").Range("A1:A10000").Find(Start, lookat:=xlPart)
    Set rngE = Sheets("Sheet1").Range("A1:A10000").Find(EndD, lookat:=xlPart)
      Sheets("Sheet1").Range("rngS.Address:rngE.Address").Copy Destination:=Sheets("mySheet01").Range("A8")



End Sub

来源:https://stackoverflow.com/questions/33553017/vba-getting-data-from-another-sheet

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!