-
WSfranciz
AskWoody LoungerHi all,
I have a CSV file that i import the data onto a payroll system. Before I import the data on one of the columns I put three zeros in front of numbers and I use the following formula =”000″ & B on a different cell i.e. f2, I then copy paste values on cell b2. this displays the zeros before the numbers on Column./ cell B2. I than save the file it gives me a few warning and click yes to those, etc. and usually when I open the file the zeros are there, but this time they are all gone.
Does anyone know what the problem is?
Cheers
I believe that Excel have converted text to number automatically.
Why don’t you try custom formatting your cell, it is much more robust -
WSfranciz
AskWoody LoungerIf it has a subtotal formula (i. e., “=subtotal(x,y)”)
I am assuming that you do not want the subtotal rows
simply click on Data on the menu bar
select Subtotals
click on Remove AllThis will remove all subtotals and grand total.
-
WSfranciz
AskWoody LoungerHi
Does the attached do what you want?
Format the cell M14 by right click
choose Format Cells >>select Custom and choose [h]:mm:ssHTH
-
WSfranciz
AskWoody LoungerThanks Prasad and Hans
However it still does the same as you can see from the screenshot below with dummy data, this is with both the & and the Concatenate formula?
Editted: helps if I attach the picture!!
I see no problem with the formula you posted.
Care to share a sample of your copy? It would be some other issue than the formula itself. -
WSfranciz
AskWoody LoungerThanks.
Is there a different between running the macro from a commandbutton
and from the workbook’s macroThe error happen at Cells.Select when I run it from a commandbutton
but its work when using the workbook’s macro.Code:Sub PasteOnlyValuesAndFormat() ' Cells.Select Selection.Copy Workbooks.Open Filename:="filespec" Sheets("Sheet1").Select Cells.Select Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, _ SkipBlanks:=False, Transpose:=False Selection.PasteSpecial Paste:=xlPasteFormats, Operation:=xlNone, _ SkipBlanks:=False, Transpose:=False End Sub
TIA
-
WSfranciz
AskWoody LoungerI’m sorry I can’t seem to get your spreed sheet to work, but thanks for your help anyway.
I tried it and its works.
Did you enable the macro when you first open the file and double click on the cell Color or Number
-
WSfranciz
AskWoody LoungerYou could use code like:
Code:Application.CutCopyMode = False Range("A1").Select
To exit CutCopyMode, and re-select the first cell in the worksheet.
You could use code like this to save the new workbook with a reference to a name in C5:
Code:Dim NewWbk As Workbook Dim strFileName As String strFileName = Range("C5").Text Set NewWbk = Workbooks.Add(Template:="Workbook") NewWbk.SaveAs Filename:=strFileName Set NewWbk = Nothing
Gary
Thanks.
-
WSfranciz
AskWoody LoungerThe variables would be those assigned by you earlier in the project.
If you need to open an existing workbook the code would change to:
Code:Sub PasteOnlyValuesAndFormat() ' Cells.Select Selection.Copy Workbooks.Open Filename:="filespec" Sheets("Sheet1").Select Cells.Select Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, _ SkipBlanks:=False, Transpose:=False Selection.PasteSpecial Paste:=xlPasteFormats, Operation:=xlNone, _ SkipBlanks:=False, Transpose:=False End Sub
If you need to open a New workbook the line
Workbooks.Open Filename:=”filespec”would be replaced with
Workbooks.Add Template:=”Workbook”Thanks, this works.
In addition, would I use this line at the end to
end the copy mode in “Template”Application.CutCopyMode = False
How could I save the new workbook with reference to the name in C5?
Again thanks for your guide.
-
WSfranciz
AskWoody LoungerAssuming that you wish to paste the data into a file whose name is stored in the variable “FN” (without the quotes), the line will change to:
Windows(FN).Activate
The line of code activates the window where you will paste the data. You will also need to ensure that the appropriate sheet is active.
How could the variables be known or come from?
What if we need open a new workbook?
How could we change this to -
WSfranciz
AskWoody LoungerDoes the following help?
Code:Sub PasteOnlyValuesAndFormat() ' Cells.Select Selection.Copy Windows("Target").Activate Cells.Select Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, _ SkipBlanks:=False, Transpose:=False Selection.PasteSpecial Paste:=xlPasteFormats, Operation:=xlNone, _ SkipBlanks:=False, Transpose:=False End Sub
Thanks for looking into this.
There’s an error at this line
Windows(“Target”).ActivateWhat does this line suppose to do?
thanks
-
WSfranciz
AskWoody LoungerPl have a look on attachment. I am struggling with formating cell to % in 2 decimal places along with up/down arrow. Any suggestion.
Seem like it can’t be formatted as percentage due to adding in the symbol as its have become text
How’s about this if you need to include percentage symbol in the result? -
WSfranciz
AskWoody LoungerI did it by going to Insert | Symbol, and selecting my required symbols out onto the worksheet. Once I had the symbols in the ws, I copied them into my formula’s.
I’m starting to wish that I had not taken this route now though, I’ve created several problems that I now have to find workarounds for.
That’s progress
grrrrrrr..
That’s what I am doing and find it really cumbersome
I am yet to try the barron’s method -
WSfranciz
AskWoody LoungerFWIW, you can simplify a lot and use a custom number format rather than conditional formatting and IF formulas. See attached (cell C1 has the custom format depending on whether it’s positive, negative or 0)
Thanks, but where and how do I get the symbol into the formula?
-
WSfranciz
AskWoody LoungerThanks Mike!
would you mind posting your file to share this
I am still lost as to how to have the symbol in the formulathanks
-
WSfranciz
AskWoody LoungerIt does – just add more sheet names to the list. If you have many sheets, it is easier to enter the sheet names in a range of cells, say H1:H10 if you have 10 sheets. You can then use H1:H10 instead of {“Sheet1″;”Sheet2″}
(If the sheet names may contain spaces, you must use ”‘”&H1:H10&”‘”)
Hi Hans
Thanks for the tip.
![]() |
Patch reliability is unclear. Unless you have an immediate, pressing need to install a specific patch, don't do it. |
SIGN IN | Not a member? | REGISTER | PLUS MEMBERSHIP |

Plus Membership
Donations from Plus members keep this site going. You can identify the people who support AskWoody by the Plus badge on their avatars.
AskWoody Plus members not only get access to all of the contents of this site -- including Susan Bradley's frequently updated Patch Watch listing -- they also receive weekly AskWoody Plus Newsletters (formerly Windows Secrets Newsletter) and AskWoody Plus Alerts, emails when there are important breaking developments.
Get Plus!
Welcome to our unique respite from the madness.
It's easy to post questions about Windows 11, Windows 10, Win8.1, Win7, Surface, Office, or browse through our Forums. Post anonymously or register for greater privileges. Keep it civil, please: Decorous Lounge rules strictly enforced. Questions? Contact Customer Support.
Search Newsletters
Search Forums
View the Forum
Search for Topics
Recent Topics
-
Office apps read-only for family members
by
b
8 minutes ago -
Defunct domain for Microsoft account
by
CWBillow
4 hours, 33 minutes ago -
24H2??
by
CWBillow
1 hour, 8 minutes ago -
W11 23H2 April Updates threw ‘class not registered’
by
WindowsPersister
1 hour, 52 minutes ago -
Master patch listing for April 8th, 2025
by
Susan Bradley
8 hours, 6 minutes ago -
TotalAV safety warning popup
by
Theodore Nicholson
1 hour, 32 minutes ago -
two pages side by side land scape
by
marc
1 day, 14 hours ago -
Deleting obsolete OneNote notebooks
by
afillat
1 day, 17 hours ago -
Word/Outlook 2024 vs Dragon Professional 16
by
Kathy Stevens
19 hours, 53 minutes ago -
Security Essentials or Defender?
by
MalcolmP
22 hours, 37 minutes ago -
April 2025 updates out
by
Susan Bradley
5 hours, 12 minutes ago -
Framework to stop selling some PCs in the US due to new tariffs
by
Alex5723
15 hours, 59 minutes ago -
WARNING about Nvidia driver version 572.83 and 4000/5000 series cards
by
Bob99
6 hours, 4 minutes ago -
Creating an Index in Word 365
by
CWBillow
1 day, 8 hours ago -
Coming at Word 365 and Table of Contents
by
CWBillow
1 day ago -
Windows 11 Insider Preview Build 22635.5170 (23H2) released to BETA
by
joep517
2 days, 11 hours ago -
Has the Microsoft Account Sharing Problem Been Fixed?
by
jknauth
2 days, 15 hours ago -
W11 24H2 – Susan Bradley
by
G Pickerell
2 days, 17 hours ago -
7 tips to get the most out of Windows 11
by
Alex5723
2 days, 15 hours ago -
Using Office apps with non-Microsoft cloud services
by
Peter Deegan
2 days, 8 hours ago -
I installed Windows 11 24H2
by
Will Fastie
14 hours, 55 minutes ago -
NotifyIcons — Put that System tray to work!
by
Deanna McElveen
2 days, 20 hours ago -
Decisions to be made before moving to Windows 11
by
Susan Bradley
2 hours, 6 minutes ago -
Port of Seattle says ransomware breach impacts 90,000 people
by
Nibbled To Death By Ducks
3 days, 5 hours ago -
Looking for personal finance software with budgeting capabilities
by
cellsee6
2 days, 13 hours ago -
ATT/Yahoo Secure Mail Key
by
Lil88reb
2 days, 13 hours ago -
Devices with apps using sprotect.sys driver might stop responding
by
Alex5723
3 days, 22 hours ago -
Neowin – 20 times computers embarrassed themselves with public BSODs and goofups
by
EP
4 days, 6 hours ago -
Slow Down in Windows 10 performance after March 2025 updates ??
by
arbrich
6 hours, 4 minutes ago -
Mail from certain domains not delivered to my outlook.com address
by
pumphouse
3 days, 15 hours ago
Recent blog posts
Key Links
Want to Advertise in the free newsletter? How about a gift subscription in honor of a birthday? Send an email to sb@askwoody.com to ask how.
Mastodon profile for DefConPatch
Mastodon profile for AskWoody
Home • About • FAQ • Posts & Privacy • Forums • My Account
Register • Free Newsletter • Plus Membership • Gift Certificates • MS-DEFCON Alerts
Copyright ©2004-2025 by AskWoody Tech LLC. All Rights Reserved.