Vba 默认情况下选中了Spread Designer 6.0 visual basic 6.0复选框

Vba 默认情况下选中了Spread Designer 6.0 visual basic 6.0复选框,vba,vb6,Vba,Vb6,我是VB6新手(我知道…它很旧,但我们仍然使用它) 我的一个旧网格出现问题,我必须对其进行更改。如下图所示,该网格是在Spread Designer中设计的,我需要做的只是在加载表单时默认选择“Change”列。 我在这里搜索了可以更改此列属性的位置,到目前为止,我只找到了右键单击并单击“编辑”时弹出的单元格类型 有人能给我指出正确的方向吗 我相信这就是我可能需要做出任何改变的地方 Private Sub GrdPriceChanges_LeaveCell(ByVal Col As Long,

我是VB6新手(我知道…它很旧,但我们仍然使用它)

我的一个旧网格出现问题,我必须对其进行更改。如下图所示,该网格是在Spread Designer中设计的,我需要做的只是在加载表单时默认选择“Change”列。 我在这里搜索了可以更改此列属性的位置,到目前为止,我只找到了右键单击并单击“编辑”时弹出的单元格类型

有人能给我指出正确的方向吗

我相信这就是我可能需要做出任何改变的地方

Private Sub GrdPriceChanges_LeaveCell(ByVal Col As Long, ByVal Row As Long, ByVal NewCol As Long, ByVal NewRow As Long, Cancel As Boolean)
Dim VatRate As Variant
Dim CostPrice As Variant
Dim SellPrice As Variant
Dim vData As Variant
Dim Margin As Variant

    If Col = 9 Then
        GrdPriceChanges.Row = Row
        GrdPriceChanges.Col = 9
        If CellPrice <> GrdPriceChanges.Value And CellPrice <> 0 Then
            GrdPriceChanges.Col = 11
            GrdPriceChanges.Value = 1
            
            GrdPriceChanges.GetText 12, Row, VatRate
            GrdPriceChanges.GetText 9, Row, SellPrice
            GrdPriceChanges.GetText 8, Row, CostPrice
            GrdPriceChanges.Col = 10
            GrdPriceChanges.Value = CalculateMargin(Val(VatRate), Val(CostPrice), Val(SellPrice))
        End If
        
    ElseIf Col = 10 Then
        GrdPriceChanges.Row = Row
        GrdPriceChanges.Col = 10
        If CellMargin <> GrdPriceChanges.Value And Val(CellMargin) <> 0 Then
            Margin = GrdPriceChanges.Value
            GrdPriceChanges.Col = 11
            GrdPriceChanges.Value = 1
            
            GrdPriceChanges.GetText 12, Row, VatRate
            GrdPriceChanges.GetText 9, Row, SellPrice
            GrdPriceChanges.GetText 8, Row, CostPrice
            GrdPriceChanges.Col = 9
            GrdPriceChanges.Value = SuggestPrice(Val(CostPrice), Val(Margin), Val(VatRate))
        End If
    End If

    GrdPriceChanges.Col = 9
    GrdPriceChanges.Row = NewRow
    CellPrice = Val(GrdPriceChanges.Value)
    GrdPriceChanges.Col = 10
    GrdPriceChanges.Row = NewRow
    CellMargin = GrdPriceChanges.Value

End Sub
Private子GrdPriceChanges\u LeaveCell(ByVal Col为Long,ByVal Row为Long,ByVal NewCol为Long,ByVal NewRow为Long,Cancel为Boolean)
作为变体的弱VatRate
作为变量的价格
变型价格
Dim vData作为变体
变暗边缘
如果Col=9,则
GrdPriceChanges.Row=行
GrdPriceChanges.Col=9
如果CellPrice GRDPrice.Value和CellPrice 0发生变化,则
GrdPriceChanges.Col=11
GrdPriceChanges.Value=1
GrdPriceChanges.GetText 12,第行,VatRate
GrdPriceChanges.GetText 9,第行,SellPrice
GrdPriceChanges.GetText 8,第行,成本价格
GrdPriceChanges.Col=10
GrdPriceChanges.Value=CalculateMargin(增值税税率、成本价、售价))
如果结束
ElseIf Col=10那么
GrdPriceChanges.Row=行
GrdPriceChanges.Col=10
如果CellMargin GrdPriceChanges.Value和Val(CellMargin)为0,则
边距=GrdPriceChanges.Value
GrdPriceChanges.Col=11
GrdPriceChanges.Value=1
GrdPriceChanges.GetText 12,第行,VatRate
GrdPriceChanges.GetText 9,第行,SellPrice
GrdPriceChanges.GetText 8,第行,成本价格
GrdPriceChanges.Col=9
GrdPriceChanges.Value=建议价格(Val(成本价)、Val(保证金)、Val(增值税))
如果结束
如果结束
GrdPriceChanges.Col=9
GrdPriceChanges.Row=NewRow
CellPrice=Val(GrdPriceChanges.Value)
GrdPriceChanges.Col=10
GrdPriceChanges.Row=NewRow
CellMargin=GrdPriceChanges.Value
端接头

要在加载表单时选择单元格

Private Sub Form_Load()
   GrdPriceChanges.SetActiveCell 10, 1
End Sub
Private Sub Form_Load()
   GrdPriceChanges.SetSelection 10, 0, 10, GrdPriceChanges.MaxRows
End Sub
要在加载表单时选择

Private Sub Form_Load()
   GrdPriceChanges.SetActiveCell 10, 1
End Sub
Private Sub Form_Load()
   GrdPriceChanges.SetSelection 10, 0, 10, GrdPriceChanges.MaxRows
End Sub

这是完美的,我最终发现它是这种形式的负载,并能够比较你上面所描述的,以解决我所需要的。非常感谢。