Skip to content

Commit

Permalink
Update Get_data.md
Browse files Browse the repository at this point in the history
Added password protection and removal to the code.
  • Loading branch information
Believe82 authored Apr 11, 2024
1 parent 44a5c58 commit 7f8b442
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions Get_data.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,18 @@ open_wb_onedrive
Set CopyWs = openwb.Worksheets("data")

'Set the sheet you would like to paste into:
Set PasteWs = ThisWorkbook.Worksheets("Sheet 1")
Set PasteWs = ThisWorkbook.Worksheets("Main")

'clear contents of the paste area to make copy easier
PasteWs.Range("A1:AA100000").ClearContents

Application.ScreenUpdating = False

With CopyWs


'Uncomment the following if you are using Passwords:
'.Unprotect Password:=pass

'Finds the last Row and last Coloumn of our data
LastRow = .Cells(Rows.Count, 1).End(xlUp).Row
LastColumn = .Cells(1, Columns.Count).End(xlToLeft).Column
Expand All @@ -30,7 +33,10 @@ With CopyWs
PasteWs.Activate
PasteWs.Range("A1").Select
PasteWs.Paste


'Uncomment the following if you are using Passwords:
'.Protect Password:=pass

End With

'closes the data workbook and saves
Expand All @@ -39,4 +45,6 @@ openwb.Close
objLogExcel.Quit

Application.ScreenUpdating = True

End Sub

0 comments on commit 7f8b442

Please sign in to comment.