Click here to Skip to main content
15,937,602 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I wanted to ask regarding VBA and updating a spread sheet column after a scan of values

my table

Column 1	Columns 2	Column 3	Column 4
123	        123	        123	        NULL
456	        456	        996	        NULL
1234	    1234	    1234	    NULL

And if i scan through the spread sheet range and wanted to set column 4 based on finding the values of cells in the range, through a loop in VBA identify row 2 val 1 = 446, value 2 = 456 and value 3 = 996.

I want to find the values first before I update any columns, after i find the values i am looking for then update. I do not want to update row by row, like capture in a data set then review the data set and then update, want to check if the values exists first.

Results set, if the values of 456, 456 and 996 are found in row 2

Column 1	Columns 2	Column 3	Column 4
123	        123	        123	       Not Found
456	        456	        996	       Found
1234	   1234	        1234	   Not Found

If no values are not found then

Column 1	Columns 2	Column 3	Column 4
123	        123	        123	        Not Found
456	        456	        996	        Not Found
1234	   1234	        1234	    Not Found
Thank you


What I have tried:

I have tried searching google but no luck, i am new to this but hope someone can help or put me in the correct direction
Posted
Updated 10-Oct-22 8:07am

1 solution

You've got 2 options:
1) For ... Next[^] loop
2) ADODB.Recordset[^]

If you need more details, then try to write a piece of code. If you get stuck, then ask detailed question.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900