Dear all,
I have some trouble with an Excel macro. I could find the command to get data from one sheet (sheet 1) to paste them to another one (sheet 2) to do so cell by cell. Now, I would like to write a loop to make it automatic on all the data of my sheet 1 (which are all in one single column) so that all these data are put into my sheet 2 but in one single row and only in one out of three cells. Here attached is a simple example of what I want to do with this macro.
Here is the code I could write but it doesn't work as I want:
If someone can help me with an example it would be very nice of you.
Cheers,
Max
I have some trouble with an Excel macro. I could find the command to get data from one sheet (sheet 1) to paste them to another one (sheet 2) to do so cell by cell. Now, I would like to write a loop to make it automatic on all the data of my sheet 1 (which are all in one single column) so that all these data are put into my sheet 2 but in one single row and only in one out of three cells. Here attached is a simple example of what I want to do with this macro.
Here is the code I could write but it doesn't work as I want:
Code:
Sub boucle_for()
N = 20 'number of lines in my data source file
initialization_number_line_file_data_source = number_line_file_data_source - 1
For i = 1 To N
Range("H9:BQ9").FormulaR1C1 = _"=[name_file_data_source.xlsx]Sheet1!Rinitialization_number_line_file_data_source+iC2"
Next
EndSub
If someone can help me with an example it would be very nice of you.
Cheers,
Max