I want to divide my collection of more than 47K full addresses from various nations into address, city, state, zip code, and country categories. I attempted numerous approaches but was unable to come up with a formula because the structure and pattern of these addresses varies. Note: I am not very familiar with Excel VBA or macros.

Jan 6, 2023 in Others 866 views

## 1 answer to this question.

This macro contains the functions Split() and IsNumeric(), it's all you need:

```Sub test()
Dim A, B As Integer
T = Split("1, 2, X", ",")
If IsNumeric(T(0)) Then A = T(0) Else A = -1
If IsNumeric(T(2)) Then B = T(2) Else B = -1

MsgBox "Result : A=[" & CStr(A) & "], B=[" & CStr(B) & "]"
End Sub```
• 63,420 points

## Export a simple Dictionary into Excel file in python

You can use pandas. import pandas as pd dict1 ...READ MORE

## Copy Text from Range in Excel into Word Document

Here are some articles that may help: Control ...READ MORE

## Write from R into template in excel while preserving formatting

you have the XLConnect package. Read the documentation or the vignette of that ...READ MORE

## How to change two different date format into single date format in excel

With data in A2, in B2 enter: =IF(ISNUMBER(A2),A2,DATE(LEFT(A2,4),MID(A2,6,2),RIGHT(A2,2))) and apply your format ...READ MORE

## Convert Rows to Columns with values in Excel using custom format

1 I having a Excel sheet with 1 ...READ MORE

## Remove formulas from all worksheets in Excel using VBA

Try this : Option Explicit Sub test1() ...READ MORE

## Calculate monthly average from daily data without PivotTable

Assuming you have the months in column D enter ...READ MORE

## Automate compound annual growth rate (CAGR) calculation

The following PowerPivot DAX formulas worked for ...READ MORE