(Solved) – multiple dims lastrow vba

  • by

Im not too familiar with VBA, so the code below is mostly just copy and paste and research, just cant couldnt find a way to use Dim multiple times to be able to use it for different columns. Is there something I could add in front of “lastrow” to make it a different without getting the “compile error: Duplication declaration in current scope”.

   Dim lastrow As Long
        lastrow = Worksheets("Sheet1").Range("A" & Rows.Count).End(xlUp).Row
   Dim pointer As Integer
        pointer = 1
   Do Until pointer > lastrow - 1
        Sheet1.Range("D" & pointer).NumberFormat = "mm/dd/yyyy"
        pointer = pointer   1


Leave a Reply

Your email address will not be published. Required fields are marked *