Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Excel '97 - Problem when pasting numbers

Status
Not open for further replies.

newphpbie

Programmer
Oct 17, 2003
110
GB
Hello. I have an excell spreadsheet which has a macro set up on it to compare to lists of data and return a value if any two of the same numbers appear.

It works fine if you enter all the numbers manually, however, if you cut and paste the numbers into the page the macro doesn't work. As in, it won't include the numbers which have been copied and pasted.

I've tried paste special and still no joy. Does this sound familiar to anyone?? Has anyone has a similar problem?? Could it be that it's just Office '97 being old and c**p??

Any ideas would be greatly appriciated.

Tony
 

I have encountered this kind of thing before.

Normally if you add 0 to each of the numbers Excel then recognises it as a proper number. You can do this using formulas or code.

You can use this code to make the selected cells into "real" numbers:

sub MakeNumbers
for each c in selection.cells
c.value = c.value + 0
next c
end sub

Hope this helps








 
hi...

when you copy -> paste some numbers they could be changed in text notification.

p.a. if you paste the row with numbers in the cells C1:C50 you can make a formula in D1

=C1*1

you've to copy this formula to D2:D50 (the formula in D50 will be =C50*1)

after that you've to copy D1:D50 and have to choose fore paste special when you are at cell C1. Then choose for (lol I've got a dutch version of Excel) not for all, not for formule, but for the next i think. (mabye its called data)

After this you have to delete D1:D50. The list only contains numbers right now.

good luck,
Henky
 
Cheers guys...I wrote a simple formlua to add a '0' to each number before inserting it into the appropiate colum and it works a treat.

Thanks for the help...

Tony
 
The other option is to copy an empty cell, select all your data and then do Edit / Paste Special / Add. This will usually coerce all the data back to numeric.

Regards
Ken............

----------------------------------------------------------------------------
[peace] Seasons Greetings and Very Best wishes to all [2thumbsup]

----------------------------------------------------------------------------
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top