Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / Programming / September 2007

Tip: Looking for answers? Try searching our database.

F2 Cells in a column

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Darin Kramer - 18 Sep 2007 16:26 GMT
Howdie,

For whatever reason excel is "not happy" with the data in column K.  If
I merely press F2 (edit mode) and then enter, it fixes the problem and
Excel is happy! Clearly I dont want to press F2 on each cell....
(currently the cell says mailto:xx@yyy.com for a whole bunch of
people...)

Any ideas...?

Me
Jim Thomlinson - 18 Sep 2007 16:46 GMT
Not too sure what you mean by not happy but here is some code to hopefully
fix the problem... Not that it will not overwrite formulas, it only changes
constants...

Sub FixStuff()
   Dim rng As Range
   Dim rngToFix As Range
   
   On Error Resume Next
   Set rngToFix = Range("K:K").SpecialCells(xlCellTypeConstants)
   On Error GoTo 0
   
   If Not rngToFix Is Nothing Then
       For Each rng In rngToFix
           rng.Value = rng.Value
       Next rng
   End If
End Sub
Signature

HTH...

Jim Thomlinson

> Howdie,
>
[quoted text clipped - 9 lines]
>
> *** Sent via Developersdex http://www.developersdex.com ***
Darin Kramer - 18 Sep 2007 16:51 GMT
Jim Sorry for not being clearer....by not happy I mean when I copy and
paste the data across into a "list" and try and synchronise the list I
get an error message. If I F2 the cell, change nothing I dont anymore...
I ran the macro... does not seem to have solved the problem....
JW - 18 Sep 2007 17:13 GMT
And the formula I provided doesn't work either?  Odd.  What format is
the value in the cell? You could always strong arm Excel and cycle
through your column of data with a VBA routine hitting F2 and enter,
but that would be a last resort IMO because it forces a lot of
overhead through Excel.  If you decide to go this route, make sure
that you execute the code by going to Tools--Macro-->Macros.
Otherwise, the code will fire in the VBE and simply show the Object
Browser.
This is assuming your bad data column is A, or 1.  Simply change the
col variable to the column number containing your bad data.
Sub strongarm()
   Dim col As Integer, r As Range
   col = 1 'column number containing bad data
   For Each r In Range(Cells(2, col), _
       Cells(Cells(65536, col).End(xlUp).Row, col))
           Application.SendKeys ("{F2}~")
   Next r
End Sub

> Jim Sorry for not being clearer....by not happy I mean when I copy and
> paste the data across into a "list" and try and synchronise the list I
> get an error message. If I F2 the cell, change nothing I dont anymore...
> I ran the macro... does not seem to have solved the problem....
>
> *** Sent via Developersdex http://www.developersdex.com ***
Darin Kramer - 18 Sep 2007 18:20 GMT
Thanks for the effort.. I know get a "search string must be specified
error?
VB is getting stuck on the line Application.SendKeys ("{F2}~")

?

Thanks

D
JW - 18 Sep 2007 21:16 GMT
Darin, that code runs fine for me on my end.  Not sure why it would be
giving you an error.  Feel free to send me your spreadsheet and I'll
take a look at it.
> Thanks for the effort.. I know get a "search string must be specified
> error?
[quoted text clipped - 7 lines]
>
> *** Sent via Developersdex http://www.developersdex.com ***
Darin Kramer - 18 Sep 2007 21:22 GMT
Thanks - where should I send it too....? :)
JW - 19 Sep 2007 13:07 GMT
The e-mail on my profile will be fine.
> Thanks - where should I send it too....? :)
>
> *** Sent via Developersdex http://www.developersdex.com ***
JW - 18 Sep 2007 16:46 GMT
Sounds like it is reformatting it when you F2 into the cell and press
enter. Do you have them formatted as hyperlinks ot just text?  If just
text, you should be able to make Excel happy by inserting a new column
and just doing something like this:
=TEXT(A1,"@")

> Howdie,
>
[quoted text clipped - 9 lines]
>
> *** Sent via Developersdex http://www.developersdex.com ***
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.