Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

VB6 send value from grid in Textbox

Posted on 2013-11-12
3
Medium Priority
?
396 Views
Last Modified: 2013-11-13
Hello all

I would like to know how i can send the value from a grid cell to a couple of textbox.

Ex:

If i click in a cell from column 0 of my MSFexgrid1, it will paste the cell value into my TEXT1.

If i click in a cell from column 1, it will send the value to TEXT2

How can i do that?

Thanks again for your help.

Clipboard.clear
Clipboard.SetText MSHFlexGrid1.Clip

Text1.Text = MSHFlexGrid1
Text1.Font.Bold = True

Open in new window

0
Comment
Question by:Wilder1626
  • 2
3 Comments
 
LVL 49

Accepted Solution

by:
Martin Liss earned 2000 total points
ID: 39643690
Private Sub MSHFlexGrid1_Click()

If MSHFlexGrid1.Col = 0 Then
    Text1.Text = MSHFlexGrid1.TextMatrix(MSHFlexGrid1.Row, MSHFlexGrid1.Col)
Else
    If MSHFlexGrid1.Col = 1 Then
        Text2.Text = MSHFlexGrid1.TextMatrix(MSHFlexGrid1.Row, MSHFlexGrid1.Col)
    End If
End If


End Sub

Open in new window

0
 
LVL 11

Author Closing Comment

by:Wilder1626
ID: 39644175
HI MartinLiss:

Thanks again for your help. this work great.
0
 
LVL 49

Expert Comment

by:Martin Liss
ID: 39644848
Once again you're welcome and I'm glad I was able to help.

Select the 'About Me' tab in my profile and you'll find links to some articles I've written (including a new one that shows how to float an ActiveX control on a sheet) that may interest you.
Marty - MVP 2009 to 2013
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

There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…
Suggested Courses

886 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