#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 13
Default Percentage sign

Hi

I am using the below code that I got off this forum. All works to my
requirements, except, in cell L31 on all of my sheets in the workbook shows
the value as a percentage, e.g. 31.16%
When runing the macro, I get the value in the summary sheet as 0.311615
Q. What alteration is required to the code and where abouts it be placed to
show the correct format?
I am not a code writer, nor understand them and only get by with copy and
paste, and therefore any help would be appriciated

thanks in advance

Brian

--
Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.a...excel/200612/1

  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 13
Default Percentage sign

brian thompson3001 wrote:
Hi

I am using the below code that I got off this forum. All works to my
requirements, except, in cell L31 on all of my sheets in the workbook shows
the value as a percentage, e.g. 31.16%
When runing the macro, I get the value in the summary sheet as 0.311615
Q. What alteration is required to the code and where abouts it be placed to
show the correct format?
I am not a code writer, nor understand them and only get by with copy and
paste, and therefore any help would be appriciated

thanks in advance



Sub Summary()
Dim ws As Worksheet
Dim i As Integer
i = 2
Sheets(1).Activate
Sheets.Add
With Sheets(1)
.Range("A1").Value = "Week"
.Range("B1").Value = "Released"
.Range("C1").Value = "Delivered"
.Range("D1").Value = "Del Late"
.Range("E1").Value = "Performance"
For Each ws In ThisWorkbook.Worksheets
If ws.Index < 1 Then
.Rows(i).Cells(1).Value = ws.Name
.Rows(i).Cells(2).Value = ws.Range("L30")
.Rows(i).Cells(3).Value = ws.Range("L27")
.Rows(i).Cells(4).Value = ws.Range("L29")
.Rows(i).Cells(5).Value = ws.Range("L31")
i = i + 1
End If
Next
End With
End Sub



Brian


--
bnt

Message posted via http://www.officekb.com

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1,726
Default Percentage sign

I think that you want

Sub Summary()
Dim ws As Worksheet
Dim i As Integer
i = 2
Sheets(1).Activate
Sheets.Add
With Sheets(1)
.Range("A1").Value = "Week"
.Range("B1").Value = "Released"
.Range("C1").Value = "Delivered"
.Range("D1").Value = "Del Late"
.Range("E1").Value = "Performance"
For Each ws In ThisWorkbook.Worksheets
If ws.Index < 1 Then
.Rows(i).Cells(1).Value = ws.Name
.Rows(i).Cells(2).Value = ws.Range("L30")
.Rows(i).Cells(3).Value = ws.Range("L27")
.Rows(i).Cells(4).Value = ws.Range("L29")
.Rows(i).Cells(5).Value = Format(ws.Range("L31").Value, "0.00%")
i = i + 1
End If
Next
End With
End Sub



--
---
HTH

Bob

(change the xxxx to gmail if mailing direct)


"brian thompson3001 via OfficeKB.com" <u15682@uwe wrote in message
news:6b0a26dd14ab9@uwe...
brian thompson3001 wrote:
Hi

I am using the below code that I got off this forum. All works to my
requirements, except, in cell L31 on all of my sheets in the workbook
shows
the value as a percentage, e.g. 31.16%
When runing the macro, I get the value in the summary sheet as 0.311615
Q. What alteration is required to the code and where abouts it be placed
to
show the correct format?
I am not a code writer, nor understand them and only get by with copy and
paste, and therefore any help would be appriciated

thanks in advance



Sub Summary()
Dim ws As Worksheet
Dim i As Integer
i = 2
Sheets(1).Activate
Sheets.Add
With Sheets(1)
.Range("A1").Value = "Week"
.Range("B1").Value = "Released"
.Range("C1").Value = "Delivered"
.Range("D1").Value = "Del Late"
.Range("E1").Value = "Performance"
For Each ws In ThisWorkbook.Worksheets
If ws.Index < 1 Then
.Rows(i).Cells(1).Value = ws.Name
.Rows(i).Cells(2).Value = ws.Range("L30")
.Rows(i).Cells(3).Value = ws.Range("L27")
.Rows(i).Cells(4).Value = ws.Range("L29")
.Rows(i).Cells(5).Value = ws.Range("L31")
i = i + 1
End If
Next
End With
End Sub



Brian


--
bnt

Message posted via http://www.officekb.com



  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 13
Default Percentage sign

thanks bob, works perfect

Merry Christmas - VBG

Brian

Bob Phillips wrote:
I think that you want

Sub Summary()
Dim ws As Worksheet
Dim i As Integer
i = 2
Sheets(1).Activate
Sheets.Add
With Sheets(1)
.Range("A1").Value = "Week"
.Range("B1").Value = "Released"
.Range("C1").Value = "Delivered"
.Range("D1").Value = "Del Late"
.Range("E1").Value = "Performance"
For Each ws In ThisWorkbook.Worksheets
If ws.Index < 1 Then
.Rows(i).Cells(1).Value = ws.Name
.Rows(i).Cells(2).Value = ws.Range("L30")
.Rows(i).Cells(3).Value = ws.Range("L27")
.Rows(i).Cells(4).Value = ws.Range("L29")
.Rows(i).Cells(5).Value = Format(ws.Range("L31").Value, "0.00%")
i = i + 1
End If
Next
End With
End Sub

Hi

[quoted text clipped - 37 lines]

Brian


--
bnt

Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.a...excel/200612/1

  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 13
Default Percentage sign

Bob

one last thing,

If I wanted the sheet that the macro has generated to be named "Summary
Sheet", What would be the coding? and same again where to place it.

regards

brian thompson3001 wrote:
thanks bob, works perfect

Merry Christmas - VBG

Brian

I think that you want

[quoted text clipped - 28 lines]

Brian



--
bnt

Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.a...excel/200612/1



  #6   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1,726
Default Percentage sign

Change the line

Sheets.Add

to

Worksheets.Add.name = "Summary"

--
---
HTH

Bob

(change the xxxx to gmail if mailing direct)


"brian thompson3001 via OfficeKB.com" <u15682@uwe wrote in message
news:6b0ab4db1d2e6@uwe...
Bob

one last thing,

If I wanted the sheet that the macro has generated to be named "Summary
Sheet", What would be the coding? and same again where to place it.

regards

brian thompson3001 wrote:
thanks bob, works perfect

Merry Christmas - VBG

Brian

I think that you want

[quoted text clipped - 28 lines]

Brian



--
bnt

Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.a...excel/200612/1



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I show percentage data with the % sign on a bar chart? Tanja Srebotnjak Charts and Charting in Excel 1 September 20th 06 08:52 PM
The fx button and the "=" sign Carolyn Excel Discussion (Misc queries) 3 August 23rd 06 11:04 PM
Displaying percentage in ranges in pivot table pamarty Excel Worksheet Functions 3 May 10th 06 09:54 PM
How can I add a percentage sign to a cell with data validation Glen Excel Worksheet Functions 4 July 12th 05 11:59 PM
Formatting percentage signs in Excel Romany Excel Discussion (Misc queries) 3 June 1st 05 07:02 PM


All times are GMT +1. The time now is 07:07 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"