Transfer activex textbox value to table on another sheet

Mikeymike_W

Board Regular
Joined
Feb 25, 2016
Messages
171
Hi,

I have a sheet called "CLP", there are several activex textboxes in this sheet.
I want to use VBA to transfer the values of each textbox into a specific named range on a table ("Data") that's on sheet "CLP Client Data"

So for example on sheet "CLP" there is a textbox named "TBDate", i want the value of this to be placed in the table "Data" under the named row "Date".

I have done something similar in other sheets but never from an activex textbox.
I have the code below but it throws up an error once it gets to the first line regarding the textboxes.

Thanks in advance for all your help,

Mike

VBA Code:
Dim rw As Long    'next available row
Dim sPath As String, i As Long
Dim ws As Worksheet
        Set ws = Worksheets("CLP Client Data")
   
    Sheets("CLP Client Data").Select
  
    ActiveSheet.Range("A3").Select
   
      ws.ListObjects("Data").ListRows.Add
        rw = Split(ws.ListObjects("Data").DataBodyRange.Address, "$")(4)

      'put the text box values in this row
      With ws
     
      .Cells(rw, "Date").Value = TBDate.Value
      .Cells(rw, "ClientID").Value = TBName.Value
 

Excel Facts

How to total the visible cells?
From the first blank cell below a filtered data set, press Alt+=. Instead of SUM, you will get SUBTOTAL(9,)
try
VBA Code:
      .Cells(rw, "Date").Value = Sheets("CLP").OLEObjects("TBdate").Object.Value
 
Upvote 0
Solution
Hi Nosparks,

Thanks very much for the help, tried it out and it works a charm, thanks you.

Part of the problem was that i had it in a module too so have moved it into the sheet.

Thanks very much for your help,

Mike
 
Upvote 0

Forum statistics

Threads
1,223,630
Messages
6,173,454
Members
452,514
Latest member
cjkelly15

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top