Henkel75
04-26-2013, 11:30 AM
Hey guys
I have a problem. :help
Im working with Excel 2010 and VBA 7.0
In Sheet1 I do a lot of calculations, which then I would like to Export to a file .TXT
I would like to save only specific columns from Sheet1 (the results of the calculations).
I need a macro for this.
For example, column G contains the time value (e.g.2013-02-01 15:00), and the column M contains the result (99.87)
I would like to save these columns to a TXT file and separate them with a semicolon and spaces
For example,
2013-02-01 15:00 ;; 99.87
2013-02-01 15:00 ;; 99.87
2013-02-01 16:00 ;; 99.82
2013-02-01 17:00 ;; 99.92
2013-02-01 18:00 ;; 99.91
2013-02-01 19:00 ;; 99.82
2013-02-01 20:00 ;; 99.81
.......................................
2013-04-01 21:00 ;; 65.71
In some cases, I want to save in .TXT more columns such as G (time), M, R, W (result)
e.q 2013-02-01 15:00 ; 15 ; 99.87 ; 32.42
One date and three different data separated by semicolons and spaces.
Macro should write to TXT file only those records in columns which I can see some values. The remaining lines where I used the condition, e.q.
= IF (H139> 0; (R139 * S139); "") In this case, the result is an empty cell, but as I tried to save the TXT files is also saves the empty cells (in the form of new lines)- spoiling the data for the chart.
Do you have any idea how to solve it?
If this problem is big, maybe some easier way?
From Sheet1 to Sheet2 send only the selected column e.q. M and R, H, Z … (time and the results of operations, without formulas and empty cells).
I'll be very grateful for your help : pray2:
I have a problem. :help
Im working with Excel 2010 and VBA 7.0
In Sheet1 I do a lot of calculations, which then I would like to Export to a file .TXT
I would like to save only specific columns from Sheet1 (the results of the calculations).
I need a macro for this.
For example, column G contains the time value (e.g.2013-02-01 15:00), and the column M contains the result (99.87)
I would like to save these columns to a TXT file and separate them with a semicolon and spaces
For example,
2013-02-01 15:00 ;; 99.87
2013-02-01 15:00 ;; 99.87
2013-02-01 16:00 ;; 99.82
2013-02-01 17:00 ;; 99.92
2013-02-01 18:00 ;; 99.91
2013-02-01 19:00 ;; 99.82
2013-02-01 20:00 ;; 99.81
.......................................
2013-04-01 21:00 ;; 65.71
In some cases, I want to save in .TXT more columns such as G (time), M, R, W (result)
e.q 2013-02-01 15:00 ; 15 ; 99.87 ; 32.42
One date and three different data separated by semicolons and spaces.
Macro should write to TXT file only those records in columns which I can see some values. The remaining lines where I used the condition, e.q.
= IF (H139> 0; (R139 * S139); "") In this case, the result is an empty cell, but as I tried to save the TXT files is also saves the empty cells (in the form of new lines)- spoiling the data for the chart.
Do you have any idea how to solve it?
If this problem is big, maybe some easier way?
From Sheet1 to Sheet2 send only the selected column e.q. M and R, H, Z … (time and the results of operations, without formulas and empty cells).
I'll be very grateful for your help : pray2: