Hi ,
I have recorded this macro ,but I do not know how many times I do have to repeat this I am quite new to VBA for excel
so I try to explain to you what I would like.
I have a xml file , which I inject into a excel 2010 file so far so good , but the lay-out is wrong I only need the "C" row because there are the info which I need , but in the wrong order , it always starts at "C3"
and I also need the next field "C4" .
but I need "C3" on "F3" and "C4" on "G3" next to each other and then there is a blank "C5" ( which I do not need)
but I need "C6" on "F6" and "C7" on "G6" and "C8" is a blank again and so on
and this until the end which could be anything , at one point the "C" row will be empty , so something like loop it until 3 blank fields on "C"
would do the trick.
I have recorded something like this
Range ("C3").Select
Selection.Copy
Range ("F3").Select
ActiveSheet.Paste
Range ("C4").Select
Application.CutCopyMode = False
Selection.Copy
Range ("G3").Select
ActiveSheet.Paste
Range ("C6").Select
Selection.Copy
Range ("F6").Select
ActiveSheet.Paste
Range ("C7").Select
Application.CutCopyMode = False
Selection.Copy
Range ("G6").Select
ActiveSheet.Paste
and so on
but looping it with always 1 blank in between is not so easy for me , and just keep recording the macro until 2000 or 3000 times
I think the must be an easier way, I have been try and looking it up via google , but couldn't find anything which fits my needs
so if someone has an idea this would be nice thanks
I have recorded this macro ,but I do not know how many times I do have to repeat this I am quite new to VBA for excel
so I try to explain to you what I would like.
I have a xml file , which I inject into a excel 2010 file so far so good , but the lay-out is wrong I only need the "C" row because there are the info which I need , but in the wrong order , it always starts at "C3"
and I also need the next field "C4" .
but I need "C3" on "F3" and "C4" on "G3" next to each other and then there is a blank "C5" ( which I do not need)
but I need "C6" on "F6" and "C7" on "G6" and "C8" is a blank again and so on
and this until the end which could be anything , at one point the "C" row will be empty , so something like loop it until 3 blank fields on "C"
would do the trick.
I have recorded something like this
Range ("C3").Select
Selection.Copy
Range ("F3").Select
ActiveSheet.Paste
Range ("C4").Select
Application.CutCopyMode = False
Selection.Copy
Range ("G3").Select
ActiveSheet.Paste
Range ("C6").Select
Selection.Copy
Range ("F6").Select
ActiveSheet.Paste
Range ("C7").Select
Application.CutCopyMode = False
Selection.Copy
Range ("G6").Select
ActiveSheet.Paste
and so on
but looping it with always 1 blank in between is not so easy for me , and just keep recording the macro until 2000 or 3000 times

I think the must be an easier way, I have been try and looking it up via google , but couldn't find anything which fits my needs
so if someone has an idea this would be nice thanks
Last edited: