ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Move/Shift cells left or right in a row (https://www.excelbanter.com/excel-programming/345556-move-shift-cells-left-right-row.html)

T.Taylor

Move/Shift cells left or right in a row
 
I would like to be able to move a selected number of cells in a row
based on a user entered value. If they enter -5, the cells values
would be moved 5 columns left of the first non-blank/non-zero cell. If
5, the values would be moved over to the right 5 spaces.

I don't know excel that well so I started by creating a macro to
generate code but the macro only recorded the first half of what I
did(the cut). After awhile, I tried a different computer and it
recorded the cut and paste but the formula in the destination column
changed from "sum($b$2*$b$3)" to "sum(#REF*$b$3)". The
formula($e$2*$e$3) in the source column also changed( to $b$2*$e$3) to
point to the new location of the data. Why did this occur?

How do I get the cells to move their values over by n spaces?

Thanks in advance.



All times are GMT +1. The time now is 04:02 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com