Logo 
Search:

MS Office Answers

Ask Question   UnAnswered
Home » Forum » MS Office       RSS Feeds
  Question Asked By: Adelisa Fischer   on Feb 14 In MS Office Category.

  
Question Answered By: Volker Fischer   on Feb 14

I have had to separate  City and State before, and this is the code  that
I have used. Hopefully it will help  you get going:

Sub IdentifyState()
Dim strCell As String
Dim strState As String
Do While ActiveCell.Value <> ""
strCell = ActiveCell.Value
ActiveCell.Offset(0, 1).Range("A1").Select
strState = Right(strCell, 2)
ActiveCell.FormulaR1C1 = strState
ActiveCell.Offset(1, -1).Range("a1").Select
Loop

End Sub

Share: 

 

This Question has 5 more answer(s). View Complete Question Thread

 
Didn't find what you were looking for? Find more on New to VBA and trying to separate data Or get search suggestion and latest updates.


Tagged: