Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default Pointers to appropriate functions

OK, I'm a semi-decent programmer with Excel/VBScript. I just have some
holes in my knowledge I need to fill.

Here's what I'm trying to do. I have a set of data in a spreadsheet. I
want to prompt the user for a column of data, take all of the data in that
column, one cell at a time, look that up in a database and populate another
column with the results.

I have this:
A B C D
101 Mickey Mantle Blue
102 Donald Duck Red
103 Homer Simpson Green
104 Bender Darobot Yellow


I want to prompt the user for the column containing the key (in the example,
A), insert a column between A and B and populate the newly inserted column
with data from the database.

The parts I can do revolve around the database. I can loop through all of
the data in A, look it up in a database and drop the results into a cell
beside it. No problem.

What I cannot do is:
a) Insert a column
b) (important) Request a column from the user

Sometimes the key will be in column A, sometimes AR. I need to prompt the
user for the column. I created a form and show it but cannot come up with
a good way to ask for the column. I have a text box and a spinner, not
elegant at all and certainly error prone.

I also have no idea how to insert a column immediately after the user's
requested column.

Pointers anyone?

Thanks!
Chris
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Pointers to appropriate functions

a) Columns("B").Entirecolumn.insert

b) Use Application.Inputbox with a Type argument of 8. This allows the user
to select a range, and you can get the column from that input. Soimething
like

Set rng = application.InputBox("hello",type:=8)
myCol = rng.column

--

HTH

RP

"Chris" wrote in message
news:k4ffd.247266$wV.64291@attbi_s54...
OK, I'm a semi-decent programmer with Excel/VBScript. I just have some
holes in my knowledge I need to fill.

Here's what I'm trying to do. I have a set of data in a spreadsheet. I
want to prompt the user for a column of data, take all of the data in that
column, one cell at a time, look that up in a database and populate

another
column with the results.

I have this:
A B C D
101 Mickey Mantle Blue
102 Donald Duck Red
103 Homer Simpson Green
104 Bender Darobot Yellow


I want to prompt the user for the column containing the key (in the

example,
A), insert a column between A and B and populate the newly inserted column
with data from the database.

The parts I can do revolve around the database. I can loop through all of
the data in A, look it up in a database and drop the results into a cell
beside it. No problem.

What I cannot do is:
a) Insert a column
b) (important) Request a column from the user

Sometimes the key will be in column A, sometimes AR. I need to prompt the
user for the column. I created a form and show it but cannot come up with
a good way to ask for the column. I have a text box and a spinner, not
elegant at all and certainly error prone.

I also have no idea how to insert a column immediately after the user's
requested column.

Pointers anyone?

Thanks!
Chris



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default Pointers to appropriate functions

Bob Phillips wrote:

a) Columns("B").Entirecolumn.insert

b) Use Application.Inputbox with a Type argument of 8. This allows the
user to select a range, and you can get the column from that input.
Soimething like

Set rng = application.InputBox("hello",type:=8)
myCol = rng.column


I'll try it out and let you know. Very fast response, thanks!

Chris
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
Mouse Pointers Charles S Excel Discussion (Misc queries) 2 July 11th 07 09:50 PM
need some pointers golem New Users to Excel 2 April 27th 07 11:05 PM
Excel Pointers to Formulas [email protected] Excel Discussion (Misc queries) 0 July 25th 06 11:48 PM
Pointers?? OzziJC Excel Discussion (Misc queries) 2 June 22nd 05 04:12 PM
In excel pointers should be availible Mike@Delphi Excel Worksheet Functions 2 March 31st 05 03:13 PM


All times are GMT +1. The time now is 06:39 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"