Finds last row and last column and formats range and copies sheet1 to new
book without formulas.
Sub CopyShtwithTWOdecimals()
For i = 1 To Sheets.Count
With Sheets(i)
lr = .Cells.Find("*", Cells(Rows.Count, Columns.Count) _
, , , xlByRows, xlPrevious).Row
lc = .Cells.Find("*", Cells(Rows.Count, Columns.Count) _
, , , xlByColumns, xlPrevious).Column
Set mf = .Cells.Find(What:="Activity", LookIn:=xlValues, _
LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, _
MatchCase:=False)
If Not mf Is Nothing Then
.Range(.Cells(mf.Row, 1), .Cells(lr, lc)).NumberFormat = "0.00"
End If
End With
Next
Sheets("Sheet1").Copy
End Sub
Don Guillett
SalesAid Software
dguille...@gmail.com
-----Original Message-----
From: Zafar Iqbal
Sent: Monday, January 23, 2012 7:34 AM
To: MS EXCEL AND VBA MACROS
Subject: Re: $$Excel-Macros$$ Paste Special Data with 2 decimals
(Permanently)
Dear Sir,
I have already tried it. Yet, as per your instructions, I did the same
again. There are two problems.
First is that decimals in print view are surely two only but in actual
it may remains more than two in background. If we increase decimals
places it will be viewable, again. I need result ROUND two decimals
permanently.
Second problem is about graph. On copy paste, its data table figures
remained with more than two decimals and date values format get
converted to number format. So, 23-Jan-2012 becomes 23931 and so on.
How to make this 23931 back to 23-Jan? Also, I do not know how to
paste special FORMAT on graph.
Please help. Thanks
Regards,
Zafar Iqbal
On Jan 23, 4:01 pm, NOORAIN ANSARI <noorain.ans...@gmail.com> wrote:
Dear Zafar,
First copy and value paste in New Sheet..
Again copy and Select data of new sheet and Format paste .
Hope it will help to you.
--
Thanks & regards,
Noorain Ansari
*http://excelmacroworld.blogspot.com/*<http://excelmacroworld.blogspot.com/>
*http://noorain-ansari.blogspot.com/*<http://noorain-ansari.blogspot.com/>
On Mon, Jan 23, 2012 at 2:28 PM, Zafar Iqbal <ziqba...@gmail.com> wrote:
> Dear Experts,
> Attached is a Sample file Excel-2003 with 03 Sheets linked with each
> others. Sheet1 is linked with data from Sheet2 by Hlookup / index
> formulas
> and it has Data Validation at Cell H1, too. Chart in this Sheet1 is also
> linked with Data at Sheet2.
> Sheet3 will get data by Paste Special from MS Project file which results
> in figures with more than 2 decimals. We need to e-mail only Sheet1
> (with
> Data + Chart) to Management without any formula. We make copy of Sheet1
> and
> save it in new file. Resultant file has chart and data with more than 2
> decimals. Please provide us macro which will permanently round data to 2
> decimals in Sheet + Chart and it will not disturb cells having text
> values coming from Hlookup, Index, etc.
> Thanks for your guidance, in advance.
> Regards,
> ZAFAR IQBAL
--
FORUM RULES (986+ members already BANNED for violation)
1) Use concise, accurate thread titles. Poor thread titles, like Please
Help, Urgent, Need Help, Formula Problem, Code Problem, and Need Advice will
not get quick attention or may not be answered.
2) Don't post a question in the thread of another member.
3) Don't post questions regarding breaking or bypassing any security
measure.
4) Acknowledge the responses you receive, good or bad.
5) Cross-promotion of, or links to, forums competitive to this forum in
signatures are prohibited.
NOTE : Don't ever post personal or confidential data in a workbook. Forum
owners and members are not responsible for any loss.
------------------------------------------------------------------------------------------------------
To post to this group, send email to excel-macros@googlegroups.com
--
FORUM RULES (986+ members already BANNED for violation)
1) Use concise, accurate thread titles. Poor thread titles, like Please Help,
Urgent, Need Help, Formula Problem, Code Problem, and Need Advice will not get
quick attention or may not be answered.
2) Don't post a question in the thread of another member.
3) Don't post questions regarding breaking or bypassing any security measure.
4) Acknowledge the responses you receive, good or bad.
5) Cross-promotion of, or links to, forums competitive to this forum in signatures are prohibited.
NOTE : Don't ever post personal or confidential data in a workbook. Forum
owners and members are not responsible for any loss.
------------------------------------------------------------------------------------------------------
To post to this group, send email to excel-macros@googlegroups.com