Excel: alphanumeric if then statements
Closed
imainternforhcs
Posts
1
Registration date
Tuesday May 27, 2008
Status
Member
Last seen
May 28, 2008
-
May 28, 2008 at 02:56 PM
Ayaz - Dec 10, 2009 at 03:54 AM
Ayaz - Dec 10, 2009 at 03:54 AM
Related:
- Excel: alphanumeric if then statements
- Excel mod apk for pc - Download - Spreadsheets
- Number to words in excel - Guide
- Excel marksheet - Guide
- Kernel for excel - Download - Backup and recovery
- Gif in excel - Guide
2 responses
You don't need a macro for that.
You can create a validation list on a hidden worksheet that has 2 columns:
Column A contains the country names; column B contains the number values.
Then create 2 named ranges:
Range named "Country" that refers to column A only, and
Range named "Country_Codes" that refers to both columns A & B.
On your user input form, add validation to the cell that the user will input the country name.
The validation type will be a list, and in the list textbox enter "=Country" (omitting the quotes).
Make sure you check "In-Cell Dropdown"
Now for the field to the right that you want to contain the number:
Use the formula "=VLOOKUP(whatever cell has the country name,Country_Codes,2,FALSE)"
Make sure that the lookup cell is protected.
You can create a validation list on a hidden worksheet that has 2 columns:
Column A contains the country names; column B contains the number values.
Then create 2 named ranges:
Range named "Country" that refers to column A only, and
Range named "Country_Codes" that refers to both columns A & B.
On your user input form, add validation to the cell that the user will input the country name.
The validation type will be a list, and in the list textbox enter "=Country" (omitting the quotes).
Make sure you check "In-Cell Dropdown"
Now for the field to the right that you want to contain the number:
Use the formula "=VLOOKUP(whatever cell has the country name,Country_Codes,2,FALSE)"
Make sure that the lookup cell is protected.
Try this
If Selection.Cells(x, 8) <> "AD" Or Selection.Cells(x, 8) <>"AE" Or Selection.Cells(x, 8) <>"AF" Then
MsgBox "Account Name cannot be empty! " & "Place: Row: " & x & " Column: 8"
GoTo Einde
End If
If Selection.Cells(x, 8) <> "AD" Or Selection.Cells(x, 8) <>"AE" Or Selection.Cells(x, 8) <>"AF" Then
MsgBox "Account Name cannot be empty! " & "Place: Row: " & x & " Column: 8"
GoTo Einde
End If
I have worksheet with 1800 Rows and 20 Colums where ("C8 :O91") and ("C96:O179") ....etc has formula and i want to hide rows if the cell <> 0 and i want rows ("C1:O5", C92:O93", "C180) .....etc to display
Can any one help in writing macro, Please note i dont have any knowledge about macro i will just copy and paste the same in the worksheet.
Please reply Urgently.
Can any one help in writing macro, Please note i dont have any knowledge about macro i will just copy and paste the same in the worksheet.
Please reply Urgently.
Mar 22, 2009 at 06:08 PM
like:
If Selection.Cells(x, 8) <> _
"AD" Or "AE" Or "AF" Or "AG" Or "AI" Or "AL" Or "AM" Or "AN" Or "AO" Or "AQ" Or "AR" Or "AS" Or "AT" Or "AU" Or "WS" Or "YE" Or "YT" Or "ZA" Or "ZM" Or "ZW" Then
MsgBox "Account Name cannot be empty! " & "Place: Row: " & x & " Column: 8"
GoTo Einde
End If
Why i got "run time Error: mismatch"??
Thanks