[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now

x
?
Solved

MSHflexgrid and copying contents to the clipboard

Posted on 2001-08-14
3
Medium Priority
?
234 Views
Last Modified: 2010-05-18
This may be a simplistic question, and it may be answered already, but I can't seem to get the search results to come up with any results.

I need a quick and easy way to copy the user selected portion of a MSHflexgrid to the clipboard.

Any takers?
0
Comment
Question by:edwinson
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 70

Expert Comment

by:Éric Moreau
ID: 6386142
Something like this:

        With mshfgMB
            'Select all data
            .Row = 0
            .Col = 0
            .RowSel = .Rows - 1
            .ColSel = .Cols - 1
            Clipboard.SetText .Clip
        End With
0
 
LVL 43

Accepted Solution

by:
TimCottee earned 600 total points
ID: 6387231
Private Sub grdTrends_MouseDown(Button As Integer, Shift As Integer, x As Single, y As Single)
    If Button = vbRightButton Then
        If MsgBox("Copy Selected Cells To Clipboard?", vbExclamation + vbYesNo) = vbYes Then
            With grdTrends
                If .Col <= .ColSel Then
                    intColStart = .Col
                    intColEnd = .ColSel
                Else
                    intColStart = .ColSel
                    intColEnd = .Col
                End If
                If .Row <= .RowSel Then
                    intRowStart = .Row
                    intRowEnd = .RowSel
                Else
                    intRowStart = .RowSel
                    intRowEnd = .Row
                End If
                strText = ""
                For intRow = intRowStart To intRowEnd
                    For intcol = intColStart To intColEnd
                        strText = strText & .TextMatrix(intRow, intcol) & IIf(intcol < intColEnd, vbTab, vbCrLf)
                    Next
                Next
                Clipboard.Clear
                Clipboard.SetText strText
            End With
        End If
    End If
End Sub
0
 
LVL 70

Expert Comment

by:Éric Moreau
ID: 6396883
Any news edwinson?
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Suggested Courses

650 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question