Hello,
I am new to Excel VBA and I would appreciate any advice (or help) given.
In the worksheet, an user will enter information (such as Policy Number). After the user finish entering the information, a command button can be pressed to begin the process. Using my code it will check the values of the Policy Number (located in Column D) against an ADODB table (CRMDB) to see if the policy number exist and if there is a Block_No's value. If the Block_No's value is blank, then a value of "No" will be entered in a Closed Block (Y/N)? (located in Column K) on the same row as the Policy Number. If the Block_No's value equals to "1011", then a value of "Yes" will be entered in that column.
Please note that my code did work based on the selected cell for Policy Number but now I wish perform a search based on values in column D (regardless of the row) and return with answers for each row based on the policy number given into column K.
I think an array may be needed for this code along with the usage of a RANGE statement, but I am getting an error " Run-time error '1004': Method 'Range of object'_Global' failed.
Here is layout of the report (using test data):
Control Company Check Policy Check Processor Process to Verfied in Check Identification / Closed
Number Number Number Number Amount to Susp Susp Date 110008 Resolution Comments Block (Y/N)?
030000892
030000856
030000888
030000892
030000924
030001159
030001231
030001350
030001351
030001352
030001400
030001558
030001570
030001626
030001801
---------------------------------------------------------------------
Sample of my table in ODBC:
Company Policy Block_No
0090 030000856 1011
0090 030000888 1011
0090 030000892 1011
0090 030000924 1011
0090 030001159 1011
0090 030001231 1011
0090 030001350 1011
0090 030001351 1011
0090 030001352 1011
0090 030001400 1011
0090 030001558 1011
0090 030001570 1011
0090 030001626 1011
0090 030001801 1011
0090 030001872 1011
0090 030002083 1011
0090 030002450 1011
---------------------------------
Here is my code:
SSorry for being too detail, just wanted to make sure that it is understandable.![]()
Please Login or Register to view this content.
Looking forward in hearing suggestions.
Thank you.
Bookmarks