How to copy the format of a cell to another by using VBA?

  • Thread starter Thread starter Á÷À˵ÄË«Óã
  • Start date Start date
Á

Á÷À˵ÄË«Óã

I want to set the format of a cell same as the another
by using vba code.How can I do that?

Thanks!

--
 
Are you familiar with recording macros in Excel? By simply recording
yourself doing anything in excel, it produces the code required to
reproduce those actions via VBA. Therefore, you could record yourself
right-clicking on the cell, selecting Format Cell... from the pop-up
menu and set the cell's format according to what the original cell's
format is, then, once finished, stop recording and retrieve the newly
produced code. Another way could be to record yourself copying the
source cell, pasting that to the destination cell, et voila! By copying
and pasting via macro, you get the desired format of the cell. See what
I mean?
 
Back
Top