Hey there! I'm pretty new to VBA so right now I am very confused.
I have a spreadsheet with a lot of information for individuals with a lot of columns but the ones i care about are: Name, Surname, Company, and Property Address.
What I have to do is use a macro(button) to move them to another spreadsheet so that there's Name, Surname, Company and Address in columns A-D. The issue is, some people have more than one address so their other properties are in columns E-K. And some people have no address. What I want to do is, if a certain person has no address, delete the line. But if they have more than one, then create a new line right underneath with the same Name, Surname and Company, but just add the second address.
So, if some guy called Paul Smith has 3 addresses it will look like this:
[TABLE="width: 254"]
<colgroup><col><col><col><col></colgroup><tbody>[TR]
[TD]Paul [/TD]
[TD]Smith[/TD]
[TD]General Motors[/TD]
[TD]ADDRESS1[/TD]
[/TR]
[TR]
[TD]Paul [/TD]
[TD]Smith[/TD]
[TD]General Motors[/TD]
[TD]ADDRESS2[/TD]
[/TR]
[TR]
[TD]Paul [/TD]
[TD]Smith[/TD]
[TD]General Motors[/TD]
[TD]ADDRESS3
[/TD]
[/TR]
</tbody>[/TABLE]
I've tried everything I can think of but nothing is working. It doesn't seem like that hard of a problem for what one can do with VBA but my brain is fried and I don't know how to work through it.
Does anyone have any advice on this? Or even, any code?
Thanks so much!
I have a spreadsheet with a lot of information for individuals with a lot of columns but the ones i care about are: Name, Surname, Company, and Property Address.
What I have to do is use a macro(button) to move them to another spreadsheet so that there's Name, Surname, Company and Address in columns A-D. The issue is, some people have more than one address so their other properties are in columns E-K. And some people have no address. What I want to do is, if a certain person has no address, delete the line. But if they have more than one, then create a new line right underneath with the same Name, Surname and Company, but just add the second address.
So, if some guy called Paul Smith has 3 addresses it will look like this:
[TABLE="width: 254"]
<colgroup><col><col><col><col></colgroup><tbody>[TR]
[TD]Paul [/TD]
[TD]Smith[/TD]
[TD]General Motors[/TD]
[TD]ADDRESS1[/TD]
[/TR]
[TR]
[TD]Paul [/TD]
[TD]Smith[/TD]
[TD]General Motors[/TD]
[TD]ADDRESS2[/TD]
[/TR]
[TR]
[TD]Paul [/TD]
[TD]Smith[/TD]
[TD]General Motors[/TD]
[TD]ADDRESS3
[/TD]
[/TR]
</tbody>[/TABLE]
I've tried everything I can think of but nothing is working. It doesn't seem like that hard of a problem for what one can do with VBA but my brain is fried and I don't know how to work through it.
Does anyone have any advice on this? Or even, any code?
Thanks so much!