Eg Copy A1 to B1 but if B1 is occupied try C1, etc until an empty cell on line 1 is found.
How can I copy data from a cell to other cells on same line, testing that they are em
Collapse
X
-
This is for MS-Excel yes?
Several ways to do this...
My way is to set the home cell and store the value
then use the offset from there to find an empty cell
Please post what you have tried so far remembering to format your code using the <CODE/> button. -
- Move the selection cursor to cell A1.
- Is the value empty?
- Yes. All done. Write value here.
- No. Using ActiveCell.Offs et(0, 1) check cell B1. Is the value empty?
- Yes. All done. Write value here.
- No. All done. Write the value in ActiveCell.End( xlToRight).Offs et(0,1).
Comment
-
That is what I gathered from OP's post too... kinda reminds me of a homework assignment which is why I asked for OP's code.
Normally I do this with range names and gotos to move imported data from one spot to another... then I found the transferworkshe et method and YEA done on the export!Comment
-
Originally posted by ZmbdZmbd:
then I found the transferworkshe et method and YEA done on the export!
Hence post #3 which lays out all the necessary steps in order to be guaranteed to find the first empty cell of the row.Comment
-
Indeed. If the cell to the right is blank then it will go to the next non-blank cell on its right. If there are no more in the row then it will go to the far-right cell of the row.
This behaviour can be seen and experimented with by using the Ctrl key with one of the arrow keys or else pressing the End key followed by one of the arrow keys.Comment
Comment