vbanewbie68
Board Regular
- Joined
- Oct 16, 2021
- Messages
- 171
- Office Version
- 365
- Platform
- Windows
- MacOS
Hi
How can I get VBA to identify and remove specific county's values like London, France, USA out of the County's column?
Please see my screenshot and my VBA codes.
Also would it be possible to add a valid county table into VBA? For example if value is Scotland under County's column and it is not match with the valid county table then it should be blank.
I hope it makes sense?
Thank you in advance.
Best regards
Rej
Sub Add_Rows_Data()
'LastRow = Imprt.Cells(1, 1).End(xlDown).Row
'How to check if a column exists in the sheet, will throw an error if it doesn't exist
'Set Imprt = ThisWorkbook.Sheets("Sheet5")
LastRow = Imprt.Cells(1, 1).End(xlDown).Row
For x = 2 To LastRow
County = WorksheetFunction.Match("County", Import.Cells(1, 1).EntireRow, 0)
'Imprt.Cells(x, County).Value = England, London, Scotland France, USA 'County
How can I get VBA to identify and remove specific county's values like London, France, USA out of the County's column?
Please see my screenshot and my VBA codes.
Also would it be possible to add a valid county table into VBA? For example if value is Scotland under County's column and it is not match with the valid county table then it should be blank.
I hope it makes sense?
Thank you in advance.
Best regards
Rej
Sub Add_Rows_Data()
'LastRow = Imprt.Cells(1, 1).End(xlDown).Row
'How to check if a column exists in the sheet, will throw an error if it doesn't exist
'Set Imprt = ThisWorkbook.Sheets("Sheet5")
LastRow = Imprt.Cells(1, 1).End(xlDown).Row
For x = 2 To LastRow
County = WorksheetFunction.Match("County", Import.Cells(1, 1).EntireRow, 0)
'Imprt.Cells(x, County).Value = England, London, Scotland France, USA 'County