PDA

View Full Version : How are these things done inside VBA Excel?



quantum231
10-07-2019, 01:23 PM
I have created a spreadsheet that must be processed and these steps require use of VBA.

1) A list exists in Column A, find its length starting from cell A2. If cell A2 is empty then list does not exist. The first empty cell is end of list. Store address of last item in list. List could also be 1 item long.
2) Where list ends, also store the address of cell at offset (1,1) from this i.e one row down and one column to the right
3) Column E contains two possible values in each cell like a drop down list basically, either "-" or "Yes". All rows where it says "Yes", the row number must be stored in some variable. For these rows, print the value of column C.
4) Validate data between two spreadsheets called "sheet1" and "sheet2". Both of them create a list as described in A. The is that, the list may or may not be the same size. But, there must be no duplicate values between these two sheets in column D. If this is so then an error message must be generated.
5) Also, the value in (4) must not exceed 255.

I intend to use the stored coordinates of cells for (1), (2) and (3) to generate text into output file.

Now I understand that for anyone here, this description may not make complete sense. I am not looking for a complete solution, just need some guidance. Obviously I have to complete this work on my own, even if someone did it for me and I decided to have more functionality, it would be inconvinient.

paulked
10-07-2019, 06:29 PM
Hi and welcome to the forum.

However, I don't get what you're trying to do... at all! Store where? And if an empty list what to do?



If Cells(1, 2) = "" Then Exit Sub



Obviously I have to complete this work on my own, even if someone did it for me and I decided to have more functionality, it would be inconvinient.

But then again, it's obvious you're just sharing a question!

snb
10-08-2019, 01:14 AM
5) Also, the value in (4) must not exceed 255.

Use data validation.