Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Selecting examples from a table EricK Excel Discussion (Misc queries) 6 July 29th 08 08:42 AM
'if' formula selecting a cell from a table Aaron Hodson \(Coversure\) Excel Worksheet Functions 3 October 31st 07 03:42 PM
Can Web Query retrieve a single HTML table cell? Joe Francisco Excel Discussion (Misc queries) 3 April 25th 06 06:18 PM
Selecting valuse from a table Dave Excel Discussion (Misc queries) 2 September 16th 05 05:28 AM
Linking a table in Access to a table in Excel using MS Query Diana[_5_] Excel Programming 1 January 16th 04 09:43 PM


All times are GMT +1. The time now is 11:05 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"