Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Selecting a cell value in VB for a Query Table
I have created a "Query Table" and have recorded a VB macro of myself editing
the "column to filter" Here is a snipet of the code that contains the area I would like to edit. I would like to make the "TUBE_DATA.construction" equal a cell value pulled from an excel worksheet. "ripe Colorant Part #`, TUBE_DATA.`Stripe Description`, TUBE_DATA.`Stripe Colorant Weight`, TUBE_DATA.`Stripe Colorant UOM`" & Chr(13) & "" & Chr(10) & "FROM TUBE_DATA TUBE_DATA" & Chr(13) & "" & Chr(10) & "WHERE (TUBE_DATA.Construction='PBF-O-30T-BL-SLT')" _ ) .Refresh BackgroundQuery:=False End With End Sub The "TUBE.DATA.construction" is the column to filter. "PBF-O-30T-BL-SLT" is the value that I would like to replace with a cell value pulled out of an excel worksheet. Please help. Thank you |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Selecting a cell value in VB for a Query Table
val = Worksheets("Sheet3").Range("B9").Value
"ripe Colorant Part #`, TUBE_DATA.`Stripe Description`, TUBE_DATA.`Stripe Colorant Weight`, TUBE_DATA.`Stripe Colorant UOM`" & Chr(13) & "" & Chr(10) & "FROM TUBE_DATA TUBE_DATA" & Chr(13) & "" & Chr(10) & "WHERE (TUBE_DATA.Construction='" & val & "')" -- Regards, Tom Ogilvy "Jarrett" wrote in message ... I have created a "Query Table" and have recorded a VB macro of myself editing the "column to filter" Here is a snipet of the code that contains the area I would like to edit. I would like to make the "TUBE_DATA.construction" equal a cell value pulled from an excel worksheet. "ripe Colorant Part #`, TUBE_DATA.`Stripe Description`, TUBE_DATA.`Stripe Colorant Weight`, TUBE_DATA.`Stripe Colorant UOM`" & Chr(13) & "" & Chr(10) & "FROM TUBE_DATA TUBE_DATA" & Chr(13) & "" & Chr(10) & "WHERE (TUBE_DATA.Construction='PBF-O-30T-BL-SLT')" _ ) .Refresh BackgroundQuery:=False End With End Sub The "TUBE.DATA.construction" is the column to filter. "PBF-O-30T-BL-SLT" is the value that I would like to replace with a cell value pulled out of an excel worksheet. Please help. Thank you |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Selecting examples from a table | Excel Discussion (Misc queries) | |||
'if' formula selecting a cell from a table | Excel Worksheet Functions | |||
Can Web Query retrieve a single HTML table cell? | Excel Discussion (Misc queries) | |||
Selecting valuse from a table | Excel Discussion (Misc queries) | |||
Linking a table in Access to a table in Excel using MS Query | Excel Programming |