编程技术、软件应用与系统模拟

(Programming, Applicaiton and Simulation)



本站目录

 

首页
ASP/Access/IIS
DELPHI/PASCAL
PASCAL高级编程
C语言编程实例
WORD
Excel
MATLAB
MINITAB讲座
Windows
DOS
SAS
生物系统模拟
土壤水分剖析器
其他



镜像站点

 

主站
北美镜象站
欧洲镜象站(1)
欧洲镜象站(2)

本站 Google

[搜索]  [站内导航]
座右铭:
只做有益人类的事
不做有害人类的事


A Form used to Pick Up from a Worksheet

Zhanshan Dong

Excel provides a handy control called RedEdit. If you put a RefEdit control on a modal form, you can easily pick up a range of cells in a worksheet. This is pretty useful when you design a complicated form to achieve a advanced function. But if you want the complicated form to be modalless, you can not use RefEdit control in the form. Otherwise you will crash Excel and freeze it. Such a disaster! But we can still use this hand control. The idea is create a very simple form in which only a few controls or just one RefEdit control are put. You can use this form to pick up data and transfer the data to the main form. Please download the simple form and VBA code by use the link at the bottom of this page. The procedure used to accept and digest the data is listed as below. To use the downloaded files, just unzip the file and import the form files in VBA editor.

    dim myrange as range
    dim VarInCol as boolean
    Me.Hide
    frmAddVariables.Show
    If frmAddVariables.redVariable.Value <> "" Then
        Set myrange = Range(frmAddVariables.redVariable.Value)
        VarInCol = frmAddVariables.rbtnCol.Value
    End If
    frmAddVariables.Hide
    Me.Show
Download source code

© 1998-, 董占山, 版权所有。
转载文章请注明出处(www.sunfinedata.com/articles)。