|
code
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
need help with how to format a cell in Excel with VB6I have a Excel spreadsheet where a cell is formatted as general. How do you change it to date or any other
format for that matter Thnaks in advance for the help -- ---------------------------------------------- Posted with NewsLeecher v3.0 Final * Binary Usenet Leeching Made Easy * http://www.newsleecher.com/?usenet ---------------------------------------------- Johnny wrote:
> I have a Excel spreadsheet where a cell is formatted as general. How Maybe this will get you going?> do you change it to date or any other format for that matter ' Format entire table. Set table = TopLeft.Worksheet.Range(TopLeft.Offset(1, 0), TopLeft.Offset(j, i)) With table .ClearFormats .NumberFormat = "0.0000" .HorizontalAlignment = xlRight .Font.Bold = False .Rows(1).Font.Bold = True .Rows(.Rows.Count).Font.Bold = True .Columns(1).Font.Bold = True .Columns(1).NumberFormat = "0" .Columns(.Columns.Count - 1).Font.Bold = True End With That formats an entire range to a specific format. Take a look at that NumberFormat property in the helpfiles. "Johnny" <~@%.com> wrote in message Karl provided info but for future reference an easy way to get started is tonews:440e399c$0$6240$c3e8da3@news.astraweb.com > I have a Excel spreadsheet where a cell is formatted as general. How > do you change it to date or any other format for that matter open excel, start recording a macro, do what you want to do manually, stop recording and then look at the generated code. It's usually not the best but it does identify the objects, properties and methods needed. -- Reply to the group so all can participate VB.Net: "Fool me once..." |
|||||||||||||||||||||||