+ Reply to Thread
Results 1 to 5 of 5

Copying Number format from one cell to a range of cells.

  1. #1
    Registered User
    Join Date
    05-30-2007
    Posts
    3

    Copying Number format from one cell to a range of cells.

    Hi everyone, I am really enjoying the flexibility of excel programming with macros. I'm doing a little project and am a little stumped at a small road block.

    problem: I have one cell: D59 in sheet "DDE" It is number formatted. I want to apply that same number format to a range of cells (from (4,52) to (10,52)). I used the following code:

    Please Login or Register  to view this content.
    I sense that I have a data type error. But I'm not sure how I could correct for this. This sounds like a really silly mistake, I hope you guys could help me out.

    Thanks in Advance,
    David

  2. #2
    Forum Contributor colofnature's Avatar
    Join Date
    05-11-2006
    Location
    -
    MS-Off Ver
    -
    Posts
    301
    By "from (4,52) to (10,52)", do you mean AZ4:AZ10, or D52:J52?

    Either way, something like:
    Please Login or Register  to view this content.


    Col
    If you give someone a program, you will frustrate them for a day; if you teach them how to program, you will frustrate them for a lifetime.

  3. #3
    Registered User
    Join Date
    05-30-2007
    Posts
    3
    Hi Col!

    Thanks so much for replying and helping me out! I did mean "AZ4:AZ10" I think that was my problem. This code is now sufficient for my program.

    However, to keep my code easier to follow; could I have used [4,52]:[10,52] where 4 and 10 corresponds to the rows and 52 the columns. That's needed because I don't know if I will be ending on row 10 or not (this is based on a user input).


    Thanks
    David

  4. #4
    Forum Contributor colofnature's Avatar
    Join Date
    05-11-2006
    Location
    -
    MS-Off Ver
    -
    Posts
    301
    Well, you could use Range(<start address>, <end address>), and Cells(<row>, <column>), like so
    Please Login or Register  to view this content.

    C

  5. #5
    Registered User
    Join Date
    05-30-2007
    Posts
    3
    Thanks C.

    You have solved all my problems, I will go on with the rest of the program now.

    In the words of the wise 'you have fustrated me for a lifetime'

    Have a wonderful day!
    David

+ 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