返回列表 上一主題 發帖

從表單Textbox到輸入儲存格的格式

從表單Textbox到輸入儲存格的格式

Userform裡的TextBox輸入資料後,
再新增將資料貼到儲存格裡,
如何將儲存後的格式改為數字??

A.rar (16.67 KB)

回復 1# h99949


    你好:
請試試如下
Private Sub CommandButton1_Click()

[A65536].End(3)(2, 1) = CInt(TextBox1)
[B65536].End(3)(2, 1) = CInt(TextBox2)
[C65536].End(3)(2, 1) = CInt(TextBox3)
[D65536].End(3)(2, 1) = CInt(TextBox4)
[E65536].End(3)(2, 1) = CInt(TextBox5)
[F65536].End(3)(2, 1) = CInt(TextBox6)
   
End Sub

TOP

回復 2# dechiuan999


OK,我試看看

謝謝

TOP

回復 3# h99949
  1. Dim AR()
  2. Private Sub UserForm_Initialize()
  3.     AR = Array(TextBox1, TextBox2, TextBox3, TextBox4, TextBox5, TextBox6)
  4. End Sub
  5. Private Sub CommandButton1_Click()
  6.     With [A65536].End(3)(2, 1).Resize(1, UBound(AR) + 1)
  7.     'With [A65536].End(xlUp).Cells(2, 1).Resize(1, UBound(AR) + 1)
  8.         .Value = AR
  9.         .Value = .Value  '但如何將儲存後的格式改為數字??
  10.     End With
  11. End Sub
複製代碼
感恩的心......(在麻辣家族討論區.用心學習會有進步的)
但資源無限,後援有限,  一天1元的贊助,人人有能力.

TOP

        靜思自在 : 君子立恆志,小人恆立志。
返回列表 上一主題