vba - How do i get my macro to transpose data that is a string and number -


i have macro transpose data horizontal vertical :

set rng = range("a1:d10") sheets("sheet3").select range("g1").select k = 0  each rw in rng.rows     each mycell in rw.columns         if isempty(mycell) exit          if mycell.column = 1             myletter = mycell         else             activecell.offset(rowoffset:=k, columnoffset:=0) = myletter             activecell.offset(rowoffset:=k, columnoffset:=1) = mycell             k = k + 1         end if     next next 

the macro works great except when run, tranposes data if data stored text chops , converts number, there way amend macro , not this?

example : if had 00293472427 macro spits out 293472427

any appreciated thanks!

forgot say, before transposing data looks :

a 22.2 11 14 21 

and after looks :

a 22.2 11 14 21 

it seems me want make copy of cells.

for each rw in rng.rows each mycell in rw.columns     if isempty(mycell) exit      if mycell.column = 1       set myletter = mycell     else        myletter.copy activecell.offset(rowoffset:=k, columnoffset:=0)        mycell.copy activecell.offset(rowoffset:=k, columnoffset:=1)         k = k + 1     end if next next 

Comments

Popular posts from this blog

angular - Ionic slides - dynamically add slides before and after -

minify - Minimizing css files -

Add a dynamic header in angular 2 http provider -