Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default inability to apply formulas

I am need of some assistance. Please let me know if you can help me re-format
some data.
I copied data from a list and saved it into an excel spreadsheet. When I
attempt to apply a formula to this data I get VALUE errors.
I can re-key the numbers into the same cells and then the formula will work??
How can I convert, or re-format this data (it is all numbers) into a
recognizable format? I have over 13,200 cells to work with.
Thanks for your assistance in addvancxe.
--
Paul
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default inability to apply formulas

Without knowing the type of data you pasted and the formulas you are
attempting to apply to that data, it is difficult to diagnose the
problem. Most likely, the data got imported as Text format, rather
than being converted to numeric data. That is, you might have a cell
containing the Text value "1" rather than a numeric value 1. If you
attempt to use the text value in a calculation, you'll usually get a
#VALUE error.

The following code will convert the selected cells to General format,
and then sets the cells to their own value, which will force a
conversion from Text to number is required by the value.

Select the cells in question and run the following code:

Sub ConvertToVals()
' assumes (1) Selection contains no formulas,
' (2) Selection contains no arrays
' (3) Selection contains no merged cells.
Selection.NumberFormat = "General"
Selection.Value = Selection.Value
End Sub

It is assumed that the selection does not have formulas, arrays, or
merged cells.

Cordially,
Chip Pearson
Microsoft MVP 1998 - 2010
Pearson Software Consulting, LLC
www.cpearson.com
[email on web site]




On Fri, 29 Jan 2010 06:19:01 -0800, Paul Roche
wrote:

I am need of some assistance. Please let me know if you can help me re-format
some data.
I copied data from a list and saved it into an excel spreadsheet. When I
attempt to apply a formula to this data I get VALUE errors.
I can re-key the numbers into the same cells and then the formula will work??
How can I convert, or re-format this data (it is all numbers) into a
recognizable format? I have over 13,200 cells to work with.
Thanks for your assistance in addvancxe.

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,058
Default inability to apply formulas

You can try to convert them if they are Text as follows:

Sub fixum()
For Each r In Selection
v = r.Value
r.Clear
r.NumberFormat = "General"
r.Value = v
Next
End Sub

First save your work. Then select some cells. Then run the macro.
--
Gary''s Student - gsnu201001


"Paul Roche" wrote:

I am need of some assistance. Please let me know if you can help me re-format
some data.
I copied data from a list and saved it into an excel spreadsheet. When I
attempt to apply a formula to this data I get VALUE errors.
I can re-key the numbers into the same cells and then the formula will work??
How can I convert, or re-format this data (it is all numbers) into a
recognizable format? I have over 13,200 cells to work with.
Thanks for your assistance in addvancxe.
--
Paul

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,522
Default inability to apply formulas

In addition, here is one I have in my personal.xls assigned to a custom
button

Sub fixmynums()
Application.ScreenUpdating = False
On Error Resume Next
For Each c In Selection
If Trim(Len(c)) 0 And c.HasFormula = False Then
c.NumberFormat = "General"
c.Value = CDbl(c)
End If
Next

Application.ScreenUpdating = True
End Sub

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"Chip Pearson" wrote in message
...
Without knowing the type of data you pasted and the formulas you are
attempting to apply to that data, it is difficult to diagnose the
problem. Most likely, the data got imported as Text format, rather
than being converted to numeric data. That is, you might have a cell
containing the Text value "1" rather than a numeric value 1. If you
attempt to use the text value in a calculation, you'll usually get a
#VALUE error.

The following code will convert the selected cells to General format,
and then sets the cells to their own value, which will force a
conversion from Text to number is required by the value.

Select the cells in question and run the following code:

Sub ConvertToVals()
' assumes (1) Selection contains no formulas,
' (2) Selection contains no arrays
' (3) Selection contains no merged cells.
Selection.NumberFormat = "General"
Selection.Value = Selection.Value
End Sub

It is assumed that the selection does not have formulas, arrays, or
merged cells.

Cordially,
Chip Pearson
Microsoft MVP 1998 - 2010
Pearson Software Consulting, LLC
www.cpearson.com
[email on web site]




On Fri, 29 Jan 2010 06:19:01 -0800, Paul Roche
wrote:

I am need of some assistance. Please let me know if you can help me
re-format
some data.
I copied data from a list and saved it into an excel spreadsheet. When I
attempt to apply a formula to this data I get VALUE errors.
I can re-key the numbers into the same cells and then the formula will
work??
How can I convert, or re-format this data (it is all numbers) into a
recognizable format? I have over 13,200 cells to work with.
Thanks for your assistance in addvancxe.


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 insert a row & have the existing formulas apply to new ce Charity Worker in Africa Excel Discussion (Misc queries) 1 October 5th 05 05:56 PM
How can I insert a row and have the existing formulas apply? Charity Worker in Africa Excel Discussion (Misc queries) 1 October 5th 05 03:43 PM
How can I insert a row and have the existing formulas apply? Charity Worker in Africa Excel Discussion (Misc queries) 0 October 5th 05 03:35 PM
How do you apply Names in formulas? Mac Excel Discussion (Misc queries) 2 August 2nd 05 11:51 PM
Using an Activex DLL to apply formulas in Excel YingYang Excel Programming 2 May 3rd 04 08:19 PM


All times are GMT +1. The time now is 11:47 PM.

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

About Us

"It's about Microsoft Excel"