Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1
Default Convert HTML to number

I have found a table on the web that I would like to use in Excel. If I copy
and paste it into Excel as HTML, it fits into the celss just fine, but I
can't do any calculations on it. If I paste it as text (Unicode or not), it
all squishes into column A. How can I change the format of the cells so that
calculations can be performed? Doing the usual Cell Format stuff doesn't
work.

Thanks.
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 695
Default Convert HTML to number

what cind of data ?
numbers, text or both?


"dth7018" skrev:

I have found a table on the web that I would like to use in Excel. If I copy
and paste it into Excel as HTML, it fits into the celss just fine, but I
can't do any calculations on it. If I paste it as text (Unicode or not), it
all squishes into column A. How can I change the format of the cells so that
calculations can be performed? Doing the usual Cell Format stuff doesn't
work.

Thanks.

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 22,906
Default Convert HTML to number

Simply formatting cells is not enough.

After re-formatting all to General, copy an empty cell, select the "numbers" and
Paste SpecialAddOKEsc.

If there are no extraneous HTML characters like non-breaking spaces in the
cells, the numbers should calculate OK.

If not, you may have to do some stripping.

David McRitchie's TRIMALL macro is your best bet for this operation.

Sub TrimALL()
'David McRitchie 2000-07-03 mod 2000-08-16 join.htm
Application.ScreenUpdating = False
Application.Calculation = xlCalculationManual
Dim cell As Range
'Also Treat CHR 0160, as a space (CHR 032)
Selection.Replace What:=Chr(160), Replacement:=Chr(32), _
LookAt:=xlPart, SearchOrder:=xlByRows, MatchCase:=False
'Trim in Excel removes extra internal spaces, VBA does not
On Error Resume Next 'in case no text cells in selection
For Each cell In Intersect(Selection, _
Selection.SpecialCells(xlConstants, xlTextValues))
cell.Value = Application.Trim(cell.Value)
Next cell
On Error GoTo 0
Application.Calculation = xlCalculationAutomatic
Application.ScreenUpdating = True
End Sub


Gord Dibben MS Excel MVP

On Tue, 18 Jul 2006 13:11:01 -0700, dth7018
wrote:

I have found a table on the web that I would like to use in Excel. If I copy
and paste it into Excel as HTML, it fits into the celss just fine, but I
can't do any calculations on it. If I paste it as text (Unicode or not), it
all squishes into column A. How can I change the format of the cells so that
calculations can be performed? Doing the usual Cell Format stuff doesn't
work.

Thanks.


  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 8
Default Convert HTML to number

hi!
may be this can help you out to remove HTML characters
but you will
have to do it at a time for one column,
1)select the column in which you have HTML characters then press Ctrl+C

to copy the column.
2) then open (windows) NOTEPAD press Ctrl+V to paste your data in
NOTPAD.
3) then press Ctrl+H to find and replace the HTML characters.
4) just select one of the HTML character normaly it should be in the
end of every line copy it then paste it as value of Find what:
5) don't put any thing in Replace with: value press replace all .
6) press Ctrl+A to copy all and paste it back in excel column.

Regards,
Salim

Gord Dibben wrote:
Simply formatting cells is not enough.

After re-formatting all to General, copy an empty cell, select the "numbers" and
Paste SpecialAddOKEsc.

If there are no extraneous HTML characters like non-breaking spaces in the
cells, the numbers should calculate OK.

If not, you may have to do some stripping.

David McRitchie's TRIMALL macro is your best bet for this operation.

Sub TrimALL()
'David McRitchie 2000-07-03 mod 2000-08-16 join.htm
Application.ScreenUpdating = False
Application.Calculation = xlCalculationManual
Dim cell As Range
'Also Treat CHR 0160, as a space (CHR 032)
Selection.Replace What:=Chr(160), Replacement:=Chr(32), _
LookAt:=xlPart, SearchOrder:=xlByRows, MatchCase:=False
'Trim in Excel removes extra internal spaces, VBA does not
On Error Resume Next 'in case no text cells in selection
For Each cell In Intersect(Selection, _
Selection.SpecialCells(xlConstants, xlTextValues))
cell.Value = Application.Trim(cell.Value)
Next cell
On Error GoTo 0
Application.Calculation = xlCalculationAutomatic
Application.ScreenUpdating = True
End Sub


Gord Dibben MS Excel MVP

On Tue, 18 Jul 2006 13:11:01 -0700, dth7018
wrote:

I have found a table on the web that I would like to use in Excel. If I copy
and paste it into Excel as HTML, it fits into the celss just fine, but I
can't do any calculations on it. If I paste it as text (Unicode or not), it
all squishes into column A. How can I change the format of the cells so that
calculations can be performed? Doing the usual Cell Format stuff doesn't
work.

Thanks.


  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 8
Default Convert HTML to number

hi!
may be this can help you out to remove HTML characters
but you will
have to do it at a time for one column,
1)select the column in which you have HTML characters then press Ctrl+C


to copy the column.
2) then open (windows) NOTEPAD press Ctrl+V to paste your data in
NOTPAD.
3) then press Ctrl+H to find and replace the HTML characters.
4) just select one of the HTML character normaly it should be in the
end of every line copy it then paste it as value of Find what:
5) don't put any thing in Replace with: value press replace all .
6) press Ctrl+A to copy all and paste it back in excel column.


Regards,
Khan



Gord Dibben wrote:
Simply formatting cells is not enough.

After re-formatting all to General, copy an empty cell, select the "numbers" and
Paste SpecialAddOKEsc.

If there are no extraneous HTML characters like non-breaking spaces in the
cells, the numbers should calculate OK.

If not, you may have to do some stripping.

David McRitchie's TRIMALL macro is your best bet for this operation.

Sub TrimALL()
'David McRitchie 2000-07-03 mod 2000-08-16 join.htm
Application.ScreenUpdating = False
Application.Calculation = xlCalculationManual
Dim cell As Range
'Also Treat CHR 0160, as a space (CHR 032)
Selection.Replace What:=Chr(160), Replacement:=Chr(32), _
LookAt:=xlPart, SearchOrder:=xlByRows, MatchCase:=False
'Trim in Excel removes extra internal spaces, VBA does not
On Error Resume Next 'in case no text cells in selection
For Each cell In Intersect(Selection, _
Selection.SpecialCells(xlConstants, xlTextValues))
cell.Value = Application.Trim(cell.Value)
Next cell
On Error GoTo 0
Application.Calculation = xlCalculationAutomatic
Application.ScreenUpdating = True
End Sub


Gord Dibben MS Excel MVP

On Tue, 18 Jul 2006 13:11:01 -0700, dth7018
wrote:

I have found a table on the web that I would like to use in Excel. If I copy
and paste it into Excel as HTML, it fits into the celss just fine, but I
can't do any calculations on it. If I paste it as text (Unicode or not), it
all squishes into column A. How can I change the format of the cells so that
calculations can be performed? Doing the usual Cell Format stuff doesn't
work.

Thanks.




  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 8
Default Convert HTML to number

hi!
may be this can help you out to remove HTML characters
but you will have to do it at a time for one column,
1)select the column in which you have HTML characters then press Ctrl+C

to copy the column.
2) then open (windows) NOTEPAD press Ctrl+V to paste your data in
NOTEPAD.
3) then press Ctrl+H to find and replace the HTML characters.
4) just select one of the HTML character normaly it should be in the
end of every line copy it then paste it as value of Find what:
5) don't put any thing in Replace with: value press replace all .
6) press Ctrl+A to copy all and paste it back in excel column.
Actully NOTEPAD can recognise those characters which excel can't.

Regards,
Salim

Gord Dibben wrote:
Simply formatting cells is not enough.

After re-formatting all to General, copy an empty cell, select the "numbers" and
Paste SpecialAddOKEsc.

If there are no extraneous HTML characters like non-breaking spaces in the
cells, the numbers should calculate OK.

If not, you may have to do some stripping.

David McRitchie's TRIMALL macro is your best bet for this operation.

Sub TrimALL()
'David McRitchie 2000-07-03 mod 2000-08-16 join.htm
Application.ScreenUpdating = False
Application.Calculation = xlCalculationManual
Dim cell As Range
'Also Treat CHR 0160, as a space (CHR 032)
Selection.Replace What:=Chr(160), Replacement:=Chr(32), _
LookAt:=xlPart, SearchOrder:=xlByRows, MatchCase:=False
'Trim in Excel removes extra internal spaces, VBA does not
On Error Resume Next 'in case no text cells in selection
For Each cell In Intersect(Selection, _
Selection.SpecialCells(xlConstants, xlTextValues))
cell.Value = Application.Trim(cell.Value)
Next cell
On Error GoTo 0
Application.Calculation = xlCalculationAutomatic
Application.ScreenUpdating = True
End Sub


Gord Dibben MS Excel MVP

On Tue, 18 Jul 2006 13:11:01 -0700, dth7018
wrote:

I have found a table on the web that I would like to use in Excel. If I copy
and paste it into Excel as HTML, it fits into the celss just fine, but I
can't do any calculations on it. If I paste it as text (Unicode or not), it
all squishes into column A. How can I change the format of the cells so that
calculations can be performed? Doing the usual Cell Format stuff doesn't
work.

Thanks.


  #7   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 8
Default Convert HTML to number

hi!
may be this can help you out to remove HTML characters
but you will have to do it at a time for one column,
1)select the column in which you have HTML characters then press Ctrl+C


to copy the column.
2) then open (windows) NOTEPAD press Ctrl+V to paste your data in
NOTEPAD.
3) then press Ctrl+H to find and replace the HTML characters.
4) just select one of the HTML character normaly it should be in the
end of every line copy it then paste it as value of Find what:
5) don't put any thing in Replace with: value press replace all .
6) press Ctrl+A to copy all and paste it back in excel column.
Actully NOTEPAD can recognise those characters which excel can't.


Regards,
Khan
Gord Dibben wrote:
Simply formatting cells is not enough.

After re-formatting all to General, copy an empty cell, select the "numbers" and
Paste SpecialAddOKEsc.

If there are no extraneous HTML characters like non-breaking spaces in the
cells, the numbers should calculate OK.

If not, you may have to do some stripping.

David McRitchie's TRIMALL macro is your best bet for this operation.

Sub TrimALL()
'David McRitchie 2000-07-03 mod 2000-08-16 join.htm
Application.ScreenUpdating = False
Application.Calculation = xlCalculationManual
Dim cell As Range
'Also Treat CHR 0160, as a space (CHR 032)
Selection.Replace What:=Chr(160), Replacement:=Chr(32), _
LookAt:=xlPart, SearchOrder:=xlByRows, MatchCase:=False
'Trim in Excel removes extra internal spaces, VBA does not
On Error Resume Next 'in case no text cells in selection
For Each cell In Intersect(Selection, _
Selection.SpecialCells(xlConstants, xlTextValues))
cell.Value = Application.Trim(cell.Value)
Next cell
On Error GoTo 0
Application.Calculation = xlCalculationAutomatic
Application.ScreenUpdating = True
End Sub


Gord Dibben MS Excel MVP

On Tue, 18 Jul 2006 13:11:01 -0700, dth7018
wrote:

I have found a table on the web that I would like to use in Excel. If I copy
and paste it into Excel as HTML, it fits into the celss just fine, but I
can't do any calculations on it. If I paste it as text (Unicode or not), it
all squishes into column A. How can I change the format of the cells so that
calculations can be performed? Doing the usual Cell Format stuff doesn't
work.

Thanks.


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
Return SEARCHED Column Number of Numeric Label and Value Sam via OfficeKB.com Excel Worksheet Functions 23 January 30th 06 06:16 PM
Excel should have a formula to convert number into words Nitish Rawat Excel Worksheet Functions 1 December 21st 05 06:55 PM
How do I convert hh:mm:ss to an absolute number (26:01:32 to 26)? Fernando Excel Discussion (Misc queries) 1 December 1st 05 05:02 PM
Convert [h]:mm sum total format to number format Guy Excel Worksheet Functions 1 August 5th 05 05:56 AM
convert text-format number to number in excel 2000%3f Larry Excel Discussion (Misc queries) 1 July 29th 05 08:18 PM


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

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"