title: Pasting user input based on current region
body: <p>I am working on set of weekly data. Every week, I will add a new set of data to the worksheet. Then, I want to prompt user for input and paste it at the specific column within the current region range. For now, my script will prompt user for input, then finding the last row of the last set of data in the worksheet. Then, i use the current region to activate the first row of the set data. Since the data will be in col E to col O, I want the inputs entered by user to be on col A to col D. </p>
  
  <p>However, when i run my script, it will not paste the user inputs from the first row of the set data and also did not stop on the last row of the set data. Based on the example, I am expecting the output to start from row 388 and last at row 406. The result that i get from my script will paste on row 404 till 811.</p>
  
  <p>For now I just try on one worksheet named "setup" but then i need to modify my script for 20 worksheets with different names.</p>
  
  <p>This is my script:</p>
  
  <pre><code>Option Explicit
  Public week, datedone, data, location As Variant
  
  Sub pqr()
  
  week = InputBox("Week:")
  datedone = InputBox("Date:")
  data = InputBox("Data:")
  location = InputBox("Location:")
  
  Dim ws As Worksheet
  Dim x As Workbook
  Dim LastRow As Long
  Dim FirstRow As Long
  
  Set x = ThisWorkbook
  
  For Each ws In x.Worksheets
      If ws.Name = "setup" Then
      LastRow = Cells(Rows.Count, "E").End(xlUp).Row
      ws.Range("E" &amp; LastRow).Activate
      FirstRow = ActiveCell.CurrentRegion.Cells(1, 1).Activate
  
  
  With ws.Range("A" &amp; LastRow).CurrentRegion
      ws.Range(.Cells(FirstRow, 1), .Cells(LastRow, 1)).Value = week
      ws.Range(.Cells(FirstRow, 2), .Cells(LastRow, 2)).Value = datedone
      ws.Range(.Cells(FirstRow, 3), .Cells(LastRow, 3)).Value = data
      ws.Range(.Cells(FirstRow, 4), .Cells(LastRow, 4)).Value = location
  End With
  
  End If
  
  Next
  
  End Sub
  </code></pre>
  
  <p>This is how the data looks like for the previous week (Week12) complete with user input data and current week (Week13) without user input data
  <a href="https://i.stack.imgur.com/IAvIE.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/IAvIE.png" alt="1. "></a></p>
  
  <p>This is the result that i get from the script
  <a href="https://i.stack.imgur.com/hDJKM.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/hDJKM.png" alt="2. "></a></p>
  
  <p>This is what i expected to get for the result
  <a href="https://i.stack.imgur.com/zSx8l.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/zSx8l.png" alt="3. "></a></p>