title: Splitting a number and concatenating split in VBA
body: <p>I’m working on a spreadsheet and have a Lot number I need to generate.  This lot number is made up of a W/O number + the last three digits of 110120 number</p>
  
  <p>The W/O number is located in cell Q7 and the 110120 number is in cell B7</p>
  
  <p>So I know I need to concatenate these two numbers together.  However 110120 number is 9 digits and I only want the last three so I think I need to split the 110120 number to have 6 digits then 3 digits, then concatenate W/O Number and last 3 digits.  Do you agree?</p>
  
  <p>I have come up with the following code:</p>
  
  <pre><code>Private Function FSABT100LotNumber(value1 As Integer) As Integer
  
  Dim strValue1 As String
  Dim strValue1WONo, strValue1110120 As String
  Dim value1WONo, value1110120 As Integer
  
  'converts the values into strings for the Left() and Right() functions
  
  strValue1 = CStr(value1)
  Select Case Len(value1) 'gives a number depending on the length of the value1
  
  Case 9 ' e.g., 902900123 = 902900, 123
  
      strValue1WONo = Left(value1, 6) ' 902900
  
      strValue1110120 = Right(value1, 3) ' 123
  
  End Select
  
  value1WONo = CInt(strValue1WONo)
  
  value1110120 = CInt(strValue1110120)
  
  
  
  Range("F29").Select
  
  ActiveCell.Value = value1WONo &amp; value110120
  
  
  
  End Function
  </code></pre>
  
  <p>However, I know there’s something not right.  I need to tell the function that the W/O number is in cell Q7 and the 110120 number is in cell B7.  Problem is I’m not sure where I do this.</p>
  
  <p>Thank you for helping me!</p>