View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
pbase[_2_] pbase[_2_] is offline
external usenet poster
 
Posts: 1
Default How can I format text pased directly from clipboard to appear in correct cells

I am an educator working on an excel gradebook. I have finished
everything except an automatic formatting routine when I paste my
student roster, which is directly from the web to the clipboard. I've
tried to use a control button and code it with the appropriate VBA. I
need to move some cells around based on certain conditions. The
problem is that some students don't have middle initials, so that
column contains data that should be in the next field for those cases
where a student has no middle initial.

I've tried to use conditional statements to accomplish this. For
example, my logic was if the cell had length greater than one, then it
was clearly not a middle initial and the data from that point on must
be shifted to the right in that row. I tried the following, which
didn't work.

If Len(e4) 1 Then
Range("E4:F4").Select
Selection.Copy
Range("F4").Select
ActiveSheet.Paste
Range("E4").Select
Selection.ClearContents
End If

Can anyone help me accomplish this?
Thank you in advance.



------------------------------------------------
~~ Message posted from http://www.ExcelTip.com/
~~ View and post usenet messages directly from http://www.ExcelForum.com/