+ Reply to Thread
Results 1 to 5 of 5

VBA to format cells.

  1. #1
    Forum Contributor
    Join Date
    05-01-2012
    Location
    London
    MS-Off Ver
    Excel 2010
    Posts
    822

    VBA to format cells.

    I'm trying to populate a template with some data but when i run the code, part of the code will populate a column with the value of 00000, after running i only have 0 in the cell.

    Is it because i am using .value??

    Section of code is;

    Please Login or Register  to view this content.

  2. #2
    Forum Expert
    Join Date
    08-02-2013
    Location
    Québec
    MS-Off Ver
    Excel 2003, 2007, 2013
    Posts
    1,412

    Re: VBA to format cells.

    Hi,
    Excel converts the values to numbers.
    Try changing the numberformat of your cells to display them as string :
    Add this line of code before :

    Please Login or Register  to view this content.
    GC Excel

    If this post helps, then click the star icon (*) in the bottom left-hand corner of my post to Add reputation.

  3. #3
    Forum Contributor
    Join Date
    05-01-2012
    Location
    London
    MS-Off Ver
    Excel 2010
    Posts
    822

    Re: VBA to format cells.

    Changed my code to the following and it still doesn't work??

    Please Login or Register  to view this content.

  4. #4
    Forum Guru Izandol's Avatar
    Join Date
    03-29-2012
    Location
    *
    MS-Off Ver
    Excel 20(03|10|13)
    Posts
    2,581

    Re: VBA to format cells.

    You are changing the format of cells for a different sheet!

  5. #5
    Forum Contributor
    Join Date
    05-01-2012
    Location
    London
    MS-Off Ver
    Excel 2010
    Posts
    822

    Re: VBA to format cells.

    Oops, of course, sorry, one of those days!!

    Much appreciated

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Format cells in one sheet then vlookup and paste format into another
    By xyz999 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-17-2013, 06:28 AM
  2. format cells-need to format cells to nearest million
    By maxsink in forum Excel General
    Replies: 1
    Last Post: 10-26-2008, 12:32 PM
  3. how do i format a cell based on format of a range of cells?
    By Chris Hardick in forum Excel General
    Replies: 2
    Last Post: 04-03-2006, 03:55 AM
  4. want format cells alignment not format cells font style
    By Jeannie Bean in forum Excel General
    Replies: 2
    Last Post: 02-10-2006, 05:35 AM
  5. Replies: 5
    Last Post: 04-12-2005, 06:06 PM

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