title: Removing last characters vba
body: <p>I have a column that has a set of Numbers on each cell.</p>
  
  <p>Im simply looking to copy the data on the column til the last row leaving behind the last 3 digits on each cell.</p>
  
  <p>I have a variable for the last row: <em>LASTROW</em> and a range already set. </p>
  
  <p>My code kinda looks like this</p>
  
  <pre><code>inputWS1.Range("A4:A" &amp; lastRow).Copy outputWS.Range("B2")
  </code></pre>
  
  <p>As i said, im looking to copy data from A4 to B2 and on, but i want to remove the last 3 characters on A4 when they move to B2 on the other sheet. </p>
  
  <p>Please Help and thanks for all your help!</p>
  
  <p>edit: my current code is :</p>
  
  <pre><code>Private Sub Update_Click()
  
  Application.ScreenUpdating = False
  Application.Calculation = xlCalculationManual
  
  Dim path As String, fileName As String
  Dim lastRowUniversal As Long, lastRowOutput As Long, rowCntr As Long, lastColumn As Long
  Dim inputWS1 As Worksheet, inputWS2 As Worksheet, inputWS3 As Worksheet, outputWS As Worksheet
  Dim rng As Range
  Dim arr As Variant
  Dim i As Long
  Const dtFORM As String = "=IF(ISNUMBER(J4:J&lt;r&gt;),DATE(YEAR(J4:J&lt;r&gt;)-1," &amp; "MONTH(J4:J&lt;r&gt;),DAY(J4:J&lt;r&gt;)),J4:J&lt;r&gt;)"
  
  
  
  'set your sheets here
  Set inputWS1 = ThisWorkbook.Sheets("Universal")
  Set inputWS2 = ThisWorkbook.Sheets("Geovera")
  Set inputWS3 = ThisWorkbook.Sheets("Citizens")
  Set outputWS = ThisWorkbook.Sheets("Carriers")
  Set rng = inputWS3.Range("D2:D")
  arr = inputWS3.Range("M2:M" &amp; LastRowCitizens)
  
      'get last rows from both sheets
  lastRowUniversal = inputWS1.Cells(Rows.Count, "A").End(xlUp).Row
  LastRowCitizens = inputWS3.Cells(Rows.Count, "A").End(xlUp).Row
  lastRowGeovera = inputWS2.Cells(Rows.Count, "A").End(xlUp).Row
  LastRowPolicy = outputWS.Cells(Rows.Count, "B").End(xlUp).Row
  lastRowOutput = outputWS.Cells(Rows.Count, "A").End(xlUp).Row
  lastColumn = inputWS1.Cells(1, Columns.Count).End(xlToLeft).Column
  
      'get last rows from both sheets
  lastRowUniversal = inputWS1.Cells(Rows.Count, "A").End(xlUp).Row
  LastRowCitizens = inputWS3.Cells(Rows.Count, "A").End(xlUp).Row
  lastRowGeovera = inputWS2.Cells(Rows.Count, "A").End(xlUp).Row
  LastRowPolicy = outputWS.Cells(Rows.Count, "B").End(xlUp).Row
  lastRowOutput = outputWS.Cells(Rows.Count, "A").End(xlUp).Row
  lastColumn = inputWS1.Cells(1, Columns.Count).End(xlToLeft).Column
  
  rowCntr = 1
  
  For i = 1 To UBound(arr)
  arr(i) = Left(arr(i), Len(arr(i)) - 3)
  Next i
  
  
  'get last rows from both sheets
  lastRowUniversal = inputWS1.Cells(Rows.Count, "A").End(xlUp).Row
  LastRowCitizens = inputWS3.Cells(Rows.Count, "A").End(xlUp).Row
  lastRowGeovera = inputWS2.Cells(Rows.Count, "A").End(xlUp).Row
  LastRowPolicy = outputWS.Cells(Rows.Count, "B").End(xlUp).Row
  lastRowOutput = outputWS.Cells(Rows.Count, "A").End(xlUp).Row
  lastColumn = inputWS1.Cells(1, Columns.Count).End(xlToLeft).Column
  
  'Universal
  inputWS1.Range("A4:A" &amp; lastRowUniversal).Copy outputWS.Range("B2")
  inputWS1.Range("B4:B" &amp; lastRowUniversal).Copy outputWS.Range("C2")
  inputWS1.Range("N4:N" &amp; lastRowUniversal).Value = inputWS1.Name
  inputWS1.Range("N4:N" &amp; lastRowUniversal).Copy outputWS.Range("E2")
  inputWS1.Range("L4:L" &amp; lastRowUniversal).Value = inputWS1.Evaluate(Replace(dtFORM, "&lt;r&gt;", lastRowUniversal))
  inputWS1.Range("L4:L" &amp; lastRowUniversal).Copy outputWS.Range("G2")
  inputWS1.Range("G4:G" &amp; lastRowUniversal).Copy outputWS.Range("H2")
  
  'Geovera
  inputWS2.Range("F2:F" &amp; lastRowGeovera).Copy outputWS.Range("B" &amp; lastRowUniversal - 1)
  inputWS2.Range("I2:I" &amp; lastRowGeovera).Copy outputWS.Range("C" &amp; lastRowUniversal - 1)
  inputWS2.Range("P2:P" &amp; lastRowGeovera).Value = inputWS2.Name
  inputWS2.Range("P2:P" &amp; lastRowGeovera).Copy outputWS.Range("E" &amp; lastRowUniversal - 1)
  inputWS2.Range("N2:N" &amp; lastRowGeovera).Copy outputWS.Range("H" &amp; lastRowUniversal - 1)
  inputWS2.Range("G2:G" &amp; lastRowGeovera).Copy outputWS.Range("G" &amp; lastRowUniversal - 1)
  
  'Citizens
  inputWS3.Range("M2:M" &amp; LastRowCitizens).Value = arr
  
  
  
  
  
  
  Application.ScreenUpdating = True
  Application.Calculation = xlCalculationAutomatic
  End Sub
  </code></pre>