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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Excel to Flexgrid

Status
Not open for further replies.

Boris10

IS-IT--Management
Jan 26, 2012
97
KE
Hi i know this topic has been discussed numerous times, however, i am failing to implement solutions that i found on the net. Could any one assist me. How can i copy a range of cell (from a single column) from an already opened Excel document and paste them respectively into a flexgrid column?

 
hi,

What have you tried already? Please post your code and all relevant information.

Skip,

[glasses]Just traded in my old subtlety...
for a NUANCE![tongue]
 
Hi Skip,

Got this code to finally copy what i want from excel. However, when it comes to text and alphanumeric strings i get a small icon at the end of each string - looks like a T. How can i avoid that?

This is my code
Code:
ClipBoard.GetFromClipboard
    With ItemGrid
     
        If Srow > 0 And .col = 1 Then
            .row = Srow
            .col = Scol
            .RowSel = .Rows - 1
            .ColSel = .Cols - 1
            Stext = ClipBoard.GetText
            .Clip = Mid(Stext, 1, Len(Stext) - 1)
            .FillStyle = flexFillSingle
        End If
    End With
 
Code:
.clip = Left(stext, len(stext)-2)

Skip,

[glasses]Just traded in my old subtlety...
for a NUANCE![tongue]
 
Hi Skip, thank you for your time. Got around the problem with your help!
 
I think that I would be more inclined to do it this way, however...
Code:
.clip = Split(Split(Split(ClipBoard.GetText, vbLf)(0), vbCr)(0), vbTab)(0)
rather than assume that the last two characters in the string are ALWAYS control characters.


Skip,

[glasses]Just traded in my old subtlety...
for a NUANCE![tongue]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top