Skip to content

Instantly share code, notes, and snippets.

@milk19873
Created August 29, 2017 03:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save milk19873/80f8f36104369788a04992e1753feda3 to your computer and use it in GitHub Desktop.
Save milk19873/80f8f36104369788a04992e1753feda3 to your computer and use it in GitHub Desktop.
Public Function DataGet(SheetName As String, StartRow As Integer, StartColumn As Integer) As Variant
Dim EndRow As Integer
Dim EndColumn As Integer
Dim Data As Variant
With Sheets(SheetName)
EndColumn = .Cells(StartRow, StartColumn).End(xlToRight).Column
EndRow = .Cells(StartRow, StartColumn).End(xlDown).row
End With
Data = Sheets(SheetName).Range(Sheets(SheetName).Cells(StartRow, StartColumn), Sheets(SheetName).Cells(EndRow, EndColumn))
DataGet = Data
End Function
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment