Delete column without deleting merged cells - excel vba -


how can delete left-most column of merged cell without deleting content?

for instance, range("a1:c1") merged .value="hi"

by doing range("a2").entirecolumn.delete(xlleft), not lose merged cell (which becomes range("a1:b1"), lose content.

why not hold value in temp variable:

sub deletecolumnretainmergedcellvalue()     'select merged cells, run subroutine.     dim v string     v = selection.cells(1, 1).value     selection.cells(1, 1).entirecolumn.delete     selection.cells(1, 1).value = v end sub 

is you're looking for? if not, please explain little more.


Comments

Popular posts from this blog

c++ - Creating new partition disk winapi -

Android Prevent Bluetooth Pairing Dialog -

php - joomla get content in onBeforeCompileHead function -