+ Reply to Thread
Results 1 to 2 of 2

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

  1. #1
    Á÷À˵ÄË&
    Guest

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

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

    Thanks!

    --



  2. #2
    Registered User
    Join Date
    08-10-2005
    Posts
    3
    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?

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1