Microsoft Office Professional 2007 Full Version for PC Logo
Posted on Jul 21, 2008
Answered by a Fixya Expert

Trustworthy Expert Solutions

At Fixya.com, our trusted experts are meticulously vetted and possess extensive experience in their respective fields. Backed by a community of knowledgeable professionals, our platform ensures that the solutions provided are thoroughly researched and validated.

View Our Top Experts

Validation using Excel VBA code

Hi Expert.. I have a sheet, where user have to fill data. There is a column Department.. user should not enter or paste a value other than defined departments. i have applied validation using data>>validation. but it works only if the user selects department from the validation list. but if he copy data from his source and paste it in my Sheet, then the validation doent work. i have created a button (Validation) on the top of the sheet, to validate the data. it validate for email id, contact numbers, name, etc... when the user clicks on this button it throws errors.. the same way it shold throw the error if the department is not in the validation list... please help me out... its urgent

Thanks in advance
Regards
Seema

1 Answer

Tim Babcock

Level 3:

An expert who has achieved level 3 by getting 1000 points

Superstar:

An expert that got 20 achievements.

All-Star:

An expert that got 10 achievements.

MVP:

An expert that got 5 achievements.

  • Microsoft Master 2,794 Answers
  • Posted on Jul 23, 2008
Tim Babcock
Microsoft Master
Level 3:

An expert who has achieved level 3 by getting 1000 points

Superstar:

An expert that got 20 achievements.

All-Star:

An expert that got 10 achievements.

MVP:

An expert that got 5 achievements.

Joined: Jun 06, 2008
Answers
2794
Questions
13
Helped
1128457
Points
7249

Thats a lot of form work to be expecting out of Excel. You might be better off using Access, creating a table. If you need to export it back to a spreadsheet you can. The validation controls are better in Access and don't have a lot of limitations to them.

Good luck on that

Add Your Answer

×

Uploading: 0%

my-video-file.mp4

Complete. Click "Add" to insert your video. Add

×

Loading...
Loading...

Related Questions:

1helpful
1answer

Excel cell replacement

To have the contents of the cell change from something you input into something else, you would need to put in a macro using VBA. You'll need someone who knows VBA to help with that.

OR... It is a lot easier to get similar results, if you are ok with using a few more cells to do it. The item# will remain where it was entered, and the product name will have to go in a different cell. In that case, you can use a lookup formula.

To do this, lets say your item# is entered in cell 'Sheet1'!C1, and you want the product_name to display in cell 'Sheet1'!D1. On another sheet (lets say sheet2) In cells 'Sheet2'!A1:B5 input the item#'s in the first column (column A1:A5) and input the matching product-names in column B1:B5. This is your lookup data. This sheet can be hidden if you want In cell 'Sheet1'!D1, use a vlookup formula that will look at the item# and find a match in the list, and display the product name for you. =vlookup('Sheet1'!C1,'Sheet2'!$A$1:$B$5,2,false)
This will display N/A# if the number can't be found.
tip

Excel- Unhide All Sheets

Advanced Hide Options

When we hide worksheets using, still user can right click on tabs and un-hide the worksheets. For example, following example will hide the worksheet and user can un hide the sheets on right click on sheet tabs:
Sub sbHideSheet() Sheets("SheetName").Visible = False 'OR Sheets("SheetName").Visible = xlSheetHidden End Sub What if you do not want to permit users to un-hide worksheet, you can set the Visible property of worksheet to xlSheetVeryHidden and lock the VBA code. so that user can not un-hide the worksheet. The below example will hide the sheet and user can not see it in un hide worksheet dialog list.
Sub sbVeryHiddenSheet()
Sheets("SheetName").Visible = xlSheetVeryHidden
End Sub
1helpful
2answers

What is exel sheet extension in office 2010 ?

Excel Workbook

.xlsx

The default Excel file format. Cannot store VBA macro code or Microsoft Excel 4.0 macro sheets (.xlm files in Excel 4.0).

Excel Macro-Enabled Workbook

.xlsm

Uses the same basic XML format as the Excel Workbook, but can store VBA macro code. Users saving an Excel workbook that has VBA code or Excel 4.0 macro sheets (.xlm files in Excel 4.0) are prompted to use this file format.

Excel Template

.xltx

The default file format for an Excel template. Cannot store VBA macro code or Excel 4.0 macro sheets (.xlm files in Excel 4.0).

Excel Macro-Enabled Template

.xltm

Can contain a VBAProject part or Excel 4.0 macro sheets (.xlm files in Excel 4.0). Workbooks created from this template inherit the VBAProject part or Excel 4.0 macro sheets that exist in the template.

Excel Add-In

.xlam

A supplemental program that runs additional code. Excel add-ins use the Open XML file format to store data, and they support using VBA projects and Excel 4.0 macro sheets.

0helpful
1answer

Excel vba

For complete guide please refer to this link
http://www.fontstuff.com/VBA/vbatut03.htm

Thanks and regards

Fixya is educating to educate
0helpful
1answer

In Excel trying to compare two ranges

I imagine that the only way is with VBA coding. This is possible if you know programming in Excel (VBA - Visual Basic for Applications).
0helpful
1answer

CODES for entering an I.D number using vba

Try the help built into Excel and give yourself time to absorb it; Excel has some of the best help in the business. VBA may be more complex than you need to solve a data entry problem. If you're trying to add data input masks in a database, why don't you try Access (the help for which is admittedly weaker because database programming is among the most complex of all productivity apps)? I learned VBA from 3 books I rented from a good public library over the course of a project that was about a month long, (because) at some point Microsoft abandoned the idea of teaching it via help screens. Still, you might join a MS developer site and those are loaded with detailed explanations and many other experts. I hope this helps... I feel your pain.
0helpful
1answer

Copying data from one sheet to another if two fileds match

Nope, sorry, although I am truly an expert at Excel formulas, I do not understand what you are trying to end up with in the final cell. We can compare a specified field with two spreadsheets - use named ranges and index/match lookup formulas. But then where you really lose me is in reading "a generic field" to find a match, and then placing what "data from another field" into what "other sheet" - ? See the confusion?

Best way to compare 2 given parameters would be to use a nested if formula, with index/match combo. Here is a simple Excel example of how such a formula could be structured:

Sample Data (columnar arangement):
A1: Part B1: Code C1: Price D1: Find Part E1: Find Code
A2: x B2: 11 C2: 5.00 D2: y E2: 12
A3: x B3: 12 C3: 6.00 D3: y E3: 11
A4: y B4: 11 C4: 7.00 D4: x E4: 12
A5: y B5: 12 C5: 8.00 D5: x E5: 11

To retrieve the price for part y with code 12 and return the value to cell F2, type the following formula in cell F2:
=INDEX($C$2:$C$5,MATCH(D2,IF($B$2:$B$5=E2,$A$2:$A$5),0))

Press CTRL+SHIFT+ENTER to enter the formula as an array formula. The formula returns the value 8.00.

To take this one step further, with range names, this example will find one value at a specified location which matches a specific row header value and column header value. Let's say the range is home values (Range=HomeVal), Column A of HomeVal contains street addresses,"row headers" (Range=StAddress), and Row 1 contains dates of the various values that are in the body of the table, "column headers" (Range=Dates). To return the specific value from the range HomeVal to another sheet, where A1=address specified and A2=date specified:
=INDEX(HomeVal,(MATCH($A$1,StAddress,0)),(MATCH($A$2,Dates,0)))

Then make sure to press CTRL+SHIFT+ENTER to enter the formula as an array formula - if you only hit enter, these types of formulas will not work properly.

Please post back if you need further help, with more details, otherwise thank you for using and rating FixYa!
0helpful
1answer

Excel Formulas

Hi,
Try using a software called MacroRunner for Excel v1.0.. you can download this from the following link
http://www.filebuzz.com/fileinfo/21205/MacroRunner_for_Excel.html

Good luck.
0helpful
5answers

Forgot password

Try this link http://www.download.com/Free-Word-Excel-Password-Wizard/3000-2092_4-10249516.html?tag=lst-0-1 It should help you unlock the Excel file and break the password. Good luck
Not finding what you are looking for?

1,924 views

Ask a Question

Usually answered in minutes!

Top Microsoft Computers & Internet Experts

Grand Canyon Tech
Grand Canyon Tech

Level 3 Expert

3867 Answers

k24674

Level 3 Expert

8093 Answers

Brad Brown

Level 3 Expert

19187 Answers

Are you a Microsoft Computer and Internet Expert? Answer questions, earn points and help others

Answer questions

Manuals & User Guides

Loading...