title: Excel VBA - Set Cell Value to Variable Adjacent to All Cells that Are Not Blank
body: <p>I have multiple reports that I need to compile into a single master file following specific steps, then put a date to the left of the new data. The steps that need to be followed are:</p>
  
  <ol>
  <li>Open a file in Directory</li>
  <li>Set a variable based on the file name to be used in a later step (I am using an InputBox function for this)</li>
  <li>Copy all cells with data in column A from that file</li>
  <li>Paste the cell data into the first blank cell in column B for my master file</li>
  <li><strong>If there is data in column B and the adjacent cell in column A is blank, change that cell's value to the variable chosen in Step 2</strong></li>
  <li>Close the file and open the next file in the directory</li>
  </ol>
  
  <p>So basically, it needs to open File X, copy everything from column A of File X to column B of the Master, then insert a date in column B of the master for each row that has data in column B</p>
  
  <p>I'm stuck on Step 5 and cannot figure out a way to find all cells that had data pasted into them from Step 4 and set the value of all cells directly to the left of them.</p>
  
  <pre><code>Option Explicit
  
  Sub ImportGroups()
  Dim fPATH As String, fNAME As String
  Dim LR As Long, NR As Long
  Dim wbGRP As Workbook, wsDEST As Worksheet
  Dim dateChooser As Variant
  Dim cell As Range
  
  
  Set wsDEST = ActiveWorkbook.Sheets("Sheet1")
  
  
  Application.DisplayAlerts = False
  
  fPATH = "C:\&lt;path&gt;\"       'remember the final \ in this string
  
  fNAME = Dir(fPATH &amp; "*")        'get the first filename in fpath
  
  Do While Len(fNAME) &gt; 0
      Set wbGRP = Workbooks.Open(fPATH &amp; fNAME)   'open the file
      LR = Range("A" &amp; Rows.Count).End(xlUp).Row  'how many rows of info?
  
      If LR &gt; 3 Then
  
          dateChooser = InputBox("Enter date based on this file name: " &amp; fNAME)
  
          ActiveSheet.Range("A1:A" &amp; LR).Copy
          wsDEST.Cells(Rows.Count, 2).End(xlUp).Offset(1, 0).PasteSpecial xlPasteValue
  
          ' This is where I need to set the value of all cells adjacent to the pasted cells
  
      End If
  
      wbGRP.Close False   'close data workbook
          fNAME = Dir         'get the next filename
  Loop
  Application.DisplayAlerts = True
  
  End Sub
  </code></pre>