|I will not be able to access zippyshare until later this evening, but in the meantime, here are my responses to your steps:|
- Select the first sheet and press Alt+11
I assume you mean Alt+F11
- In VBA project double click ThisWorkbook to open macro writing page
- In writing page, First Drop down select workbook and in second drop down Sheet change
- Copy paste the Macro writing that you had send to me except first line and last line(End sub)
There is no real need to perform these steps. You can simply copy the entire macro from my post into the VBA editor. The first and last lines are already included. The VBA editor creates the first and last lines merely as a convenience, but you can just as easily type them in yourself or paste them directly into the editor. In other words, there is nothing magic about what the VBA editor does when it creates those 2 lines other than provide the correct syntax, which is already in the code I posted.
- Go to Excel page and write some of the serial no( J32-ff5434S) in one of the cell(Sheet no 1 cell# F17) and press enter
- Suddenly appear a dialog box telling
:- Run-time error '1004':
When I write a value in F17, nothing happens because that is the only occurrence of the value in the new workbook that I created. However, if I then Copy/Paste that value into any cell within the ranges F15:G32, F64:G70 on any sheet, I get the message box telling me the location of the duplicates. In other words, no errors. The code does exactly what I expect it to do.
Also I cannot save the file with VBA after doing the above, the excel ask to save the file without VBA. If i do so it will erase all the Macro writing when I open next time.
Are you sure that you are reading the Save message from Excel correctly? When you try to save a file that contains a macro in Excel 2007 or later and the file type is set to the default of xlsx, Excel will ask you if you want "To continue saving as a macro-free workbook, click Yes". However, it also gives you the option to click No, so that you can change the file type to xlsm or xlsb. Once you do that, you can save the file with the macro.
If Excel is not giving you those options, then something weird is going on. Perhaps the file you posted at zippyshare will help us figure out what is going on.
Have you tired this in a new workbook or only in the existing workbook?
Click Here Before Posting Data or VBA Code ---> How To Post Data or Code.