VBA value into table

ldarley

Board Regular
Joined
Apr 10, 2012
Messages
106
Office Version
  1. 2019
  2. 2016
Hi I want to drop several values into a table inside my workbook using VBA, I can match to the correct column and row of the table using index match, but once I've located the correct place in the table, how do I drop the value into that cell?

My index match works and is as follows:

VBA Code:
Application.WorksheetFunction.Index(tbl.DataBodyRange, Application.WorksheetFunction.Match(Format(StartDate, "dd/mm/yyyy"), tbl.HeaderRowRange, 0), Application.WorksheetFunction.Match(Type, tbl.ListColumns(2).DataBodyRange, 0))

So basically match the date variable to the column header date (HeaderROwRange) and then match the type variable (string) to the type column (listcolumns(2)). Now I've got that location how do I drop some text into that cell, e.g. "Start Date"? There will be several similar lines matching on different variable.

Thanks I'm sure this is more straight forward than my brain is allowing it to be!

Thanks
 

Excel Facts

Workdays for a market open Mon, Wed, Friday?
Yes! Use "0101011" for the weekend argument in NETWORKDAYS.INTL or WORKDAY.INTL. The 7 digits start on Monday. 1 means it is a weekend.
of course, i don't fully understand the problem; however, why not just write a vba custom function to return the expected result, and then reference the function in your table?
 
Upvote 0

Forum statistics

Threads
1,214,987
Messages
6,122,614
Members
449,090
Latest member
vivek chauhan

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