ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Multiple input variables (https://www.excelbanter.com/excel-programming/372191-multiple-input-variables.html)

[email protected]

Multiple input variables
 
I am trying to make a macro that will allow me to specify the number of
compounds that will be used in an experiment and then display that many
input boxes (or a list box if that will work) for the user to input the
names of the compounds. I am having a hard time figuring out if this
is possible because the loop doesn't seem to want to keep the names of
each compound separate. Any help would be much appreciated.

TIA
Stephen


Die_Another_Day

Multiple input variables
 
Try something like this:
Dim numCompounds as long
Dim cnt as long
numCompounds = InputBox("Enter the Number of Compounds")
For cnt = 1 to numCompounds
Range("A" & cnt) = InputBox("Please Enter Compound " & cnt)
next

Charles
wrote:
I am trying to make a macro that will allow me to specify the number of
compounds that will be used in an experiment and then display that many
input boxes (or a list box if that will work) for the user to input the
names of the compounds. I am having a hard time figuring out if this
is possible because the loop doesn't seem to want to keep the names of
each compound separate. Any help would be much appreciated.

TIA
Stephen



[email protected]

Multiple input variables
 
So would there be a way to call on these later on? If I was to specify
what compounds were there and then input a range of data is there a way
to enter what cells contain what compounds to make calculations easier?
Most compounds will have multiple cells which will require an average.
Die_Another_Day wrote:
Try something like this:
Dim numCompounds as long
Dim cnt as long
numCompounds = InputBox("Enter the Number of Compounds")
For cnt = 1 to numCompounds
Range("A" & cnt) = InputBox("Please Enter Compound " & cnt)
next

Charles
wrote:
I am trying to make a macro that will allow me to specify the number of
compounds that will be used in an experiment and then display that many
input boxes (or a list box if that will work) for the user to input the
names of the compounds. I am having a hard time figuring out if this
is possible because the loop doesn't seem to want to keep the names of
each compound separate. Any help would be much appreciated.

TIA
Stephen



Die_Another_Day

Multiple input variables
 
Use an array variable:
Dim Compounds() As String
Dim numCompounds as long
Dim cnt as long
numCompounds = InputBox("Enter the Number of Compounds")
ReDim Compounds(1 to numCompounds)
For cnt = 1 to numCompounds
Compounds(cnt) = InputBox("Please Enter Compound " & cnt)
next

Then Reference like this:
Variable1 = Compounds(1)

Charles

wrote:
So would there be a way to call on these later on? If I was to specify
what compounds were there and then input a range of data is there a way
to enter what cells contain what compounds to make calculations easier?
Most compounds will have multiple cells which will require an average.
Die_Another_Day wrote:
Try something like this:
Dim numCompounds as long
Dim cnt as long
numCompounds = InputBox("Enter the Number of Compounds")
For cnt = 1 to numCompounds
Range("A" & cnt) = InputBox("Please Enter Compound " & cnt)
next

Charles
wrote:
I am trying to make a macro that will allow me to specify the number of
compounds that will be used in an experiment and then display that many
input boxes (or a list box if that will work) for the user to input the
names of the compounds. I am having a hard time figuring out if this
is possible because the loop doesn't seem to want to keep the names of
each compound separate. Any help would be much appreciated.

TIA
Stephen



[email protected]

Multiple input variables
 
Thanks so much for your help, I have been trying to work this out to
make my research easier for a week now. I figured I would be able to
get it all done myself, apparently not though.

Thanks again
Die_Another_Day wrote:
Use an array variable:
Dim Compounds() As String
Dim numCompounds as long
Dim cnt as long
numCompounds = InputBox("Enter the Number of Compounds")
ReDim Compounds(1 to numCompounds)
For cnt = 1 to numCompounds
Compounds(cnt) = InputBox("Please Enter Compound " & cnt)
next

Then Reference like this:
Variable1 = Compounds(1)

Charles

wrote:
So would there be a way to call on these later on? If I was to specify
what compounds were there and then input a range of data is there a way
to enter what cells contain what compounds to make calculations easier?
Most compounds will have multiple cells which will require an average.
Die_Another_Day wrote:
Try something like this:
Dim numCompounds as long
Dim cnt as long
numCompounds = InputBox("Enter the Number of Compounds")
For cnt = 1 to numCompounds
Range("A" & cnt) = InputBox("Please Enter Compound " & cnt)
next

Charles
wrote:
I am trying to make a macro that will allow me to specify the number of
compounds that will be used in an experiment and then display that many
input boxes (or a list box if that will work) for the user to input the
names of the compounds. I am having a hard time figuring out if this
is possible because the loop doesn't seem to want to keep the names of
each compound separate. Any help would be much appreciated.

TIA
Stephen



[email protected]

Multiple input variables
 
I had one more quick question, so if I were to put in the data in an
array format (8x8, 9x9, etc.) is there any way that I would be able to
highlight the cells that correspond to compound 1 (say cells 1-4),
compound 2 (5-8), etc. and have the macro calculate averages based on
this? Sometimes my data will get up to 12x12 and writing a repetitive
if...then statement covering sample numbers ranging from 1-48 would be
really tedious. Not sure if there is a way that the you can denote
cells on a template lets say and have excel use the corresponding cells
for calculations.


Die_Another_Day

Multiple input variables
 
I have no idea what you are asking, but it sounds simple if I can
figure out what you want to do...

Charles

wrote:
I had one more quick question, so if I were to put in the data in an
array format (8x8, 9x9, etc.) is there any way that I would be able to
highlight the cells that correspond to compound 1 (say cells 1-4),
compound 2 (5-8), etc. and have the macro calculate averages based on
this? Sometimes my data will get up to 12x12 and writing a repetitive
if...then statement covering sample numbers ranging from 1-48 would be
really tedious. Not sure if there is a way that the you can denote
cells on a template lets say and have excel use the corresponding cells
for calculations.



[email protected]

Multiple input variables
 
So basically I have a 96 well plate (rows A-H, columns 1-12). I do
duplicate samples (2 wells per sample). The problem is that the layout
of my plate is not always the same. Sometimes I have samples in B1:B2
and sometimes there may be controls there. Basically I am hoping there
is a way to tell excel, if I have the formula, to use sample 1 data
(whatever cells I tell excel they are in) to calculate what I need. It
would be easy to set up if my plate always had the same layout, but
that isn't always the case. So essentially I am looking for a way to
tell excel that 2 to n data points are from sample one and to calculate
an average from those 2 to n data points.

Die_Another_Day wrote:
I have no idea what you are asking, but it sounds simple if I can
figure out what you want to do...

Charles

wrote:
I had one more quick question, so if I were to put in the data in an
array format (8x8, 9x9, etc.) is there any way that I would be able to
highlight the cells that correspond to compound 1 (say cells 1-4),
compound 2 (5-8), etc. and have the macro calculate averages based on
this? Sometimes my data will get up to 12x12 and writing a repetitive
if...then statement covering sample numbers ranging from 1-48 would be
really tedious. Not sure if there is a way that the you can denote
cells on a template lets say and have excel use the corresponding cells
for calculations.



Die_Another_Day

Multiple input variables
 
I apologize for being dense, but I still don't quite see what you want.
Do you have Row and Column headings to go off of? Could you email me an
example workbook of what you are trying to do?

Charles


wrote:
So basically I have a 96 well plate (rows A-H, columns 1-12). I do
duplicate samples (2 wells per sample). The problem is that the layout
of my plate is not always the same. Sometimes I have samples in B1:B2
and sometimes there may be controls there. Basically I am hoping there
is a way to tell excel, if I have the formula, to use sample 1 data
(whatever cells I tell excel they are in) to calculate what I need. It
would be easy to set up if my plate always had the same layout, but
that isn't always the case. So essentially I am looking for a way to
tell excel that 2 to n data points are from sample one and to calculate
an average from those 2 to n data points.

Die_Another_Day wrote:
I have no idea what you are asking, but it sounds simple if I can
figure out what you want to do...

Charles

wrote:
I had one more quick question, so if I were to put in the data in an
array format (8x8, 9x9, etc.) is there any way that I would be able to
highlight the cells that correspond to compound 1 (say cells 1-4),
compound 2 (5-8), etc. and have the macro calculate averages based on
this? Sometimes my data will get up to 12x12 and writing a repetitive
if...then statement covering sample numbers ranging from 1-48 would be
really tedious. Not sure if there is a way that the you can denote
cells on a template lets say and have excel use the corresponding cells
for calculations.



NickHK

Multiple input variables
 
Charles,
Let me know if I'm on the right track.

So each sample
- takes up 2 wells
- can contain multiple compounds

And there will (probably) be duplicates in the compounds used among all the
samples.

And a well may contain a control instead of a sample

NickHK

wrote in message
ups.com...
So basically I have a 96 well plate (rows A-H, columns 1-12). I do
duplicate samples (2 wells per sample). The problem is that the layout
of my plate is not always the same. Sometimes I have samples in B1:B2
and sometimes there may be controls there. Basically I am hoping there
is a way to tell excel, if I have the formula, to use sample 1 data
(whatever cells I tell excel they are in) to calculate what I need. It
would be easy to set up if my plate always had the same layout, but
that isn't always the case. So essentially I am looking for a way to
tell excel that 2 to n data points are from sample one and to calculate
an average from those 2 to n data points.

Die_Another_Day wrote:
I have no idea what you are asking, but it sounds simple if I can
figure out what you want to do...

Charles

wrote:
I had one more quick question, so if I were to put in the data in an
array format (8x8, 9x9, etc.) is there any way that I would be able to
highlight the cells that correspond to compound 1 (say cells 1-4),
compound 2 (5-8), etc. and have the macro calculate averages based on
this? Sometimes my data will get up to 12x12 and writing a repetitive
if...then statement covering sample numbers ranging from 1-48 would be
really tedious. Not sure if there is a way that the you can denote
cells on a template lets say and have excel use the corresponding

cells
for calculations.





[email protected]

Multiple input variables
 
Each sample will be in at least 2 wells (up to 12 wells per sample
though) and there will only be one sample per well. The reason I need
something that will allow me to specify which wells have which sample
is because there can be anywhere from 2-12 wells per sample. And yes,
there will always be controls somewhere in the data. But each well
will only contain a single sample or a single control.
NickHK wrote:
Charles,
Let me know if I'm on the right track.

So each sample
- takes up 2 wells
- can contain multiple compounds

And there will (probably) be duplicates in the compounds used among all the
samples.

And a well may contain a control instead of a sample

NickHK

wrote in message
ups.com...
So basically I have a 96 well plate (rows A-H, columns 1-12). I do
duplicate samples (2 wells per sample). The problem is that the layout
of my plate is not always the same. Sometimes I have samples in B1:B2
and sometimes there may be controls there. Basically I am hoping there
is a way to tell excel, if I have the formula, to use sample 1 data
(whatever cells I tell excel they are in) to calculate what I need. It
would be easy to set up if my plate always had the same layout, but
that isn't always the case. So essentially I am looking for a way to
tell excel that 2 to n data points are from sample one and to calculate
an average from those 2 to n data points.

Die_Another_Day wrote:
I have no idea what you are asking, but it sounds simple if I can
figure out what you want to do...

Charles

wrote:
I had one more quick question, so if I were to put in the data in an
array format (8x8, 9x9, etc.) is there any way that I would be able to
highlight the cells that correspond to compound 1 (say cells 1-4),
compound 2 (5-8), etc. and have the macro calculate averages based on
this? Sometimes my data will get up to 12x12 and writing a repetitive
if...then statement covering sample numbers ranging from 1-48 would be
really tedious. Not sure if there is a way that the you can denote
cells on a template lets say and have excel use the corresponding

cells
for calculations.




Tim Williams

Multiple input variables
 
How are you getting your data - from a platereader? Is there anything in
the datafile which maps to specific well contents ?

What format is the file - linear or matrix ? It's sometimes easier to
design anround the raw data format...
And it sounds like your plate layout is not fixed either (12 x 12 ?)

Tim


wrote in message
ups.com...
Each sample will be in at least 2 wells (up to 12 wells per sample
though) and there will only be one sample per well. The reason I need
something that will allow me to specify which wells have which sample
is because there can be anywhere from 2-12 wells per sample. And yes,
there will always be controls somewhere in the data. But each well
will only contain a single sample or a single control.
NickHK wrote:
Charles,
Let me know if I'm on the right track.

So each sample
- takes up 2 wells
- can contain multiple compounds

And there will (probably) be duplicates in the compounds used among all
the
samples.

And a well may contain a control instead of a sample

NickHK

wrote in message
ups.com...
So basically I have a 96 well plate (rows A-H, columns 1-12). I do
duplicate samples (2 wells per sample). The problem is that the layout
of my plate is not always the same. Sometimes I have samples in B1:B2
and sometimes there may be controls there. Basically I am hoping there
is a way to tell excel, if I have the formula, to use sample 1 data
(whatever cells I tell excel they are in) to calculate what I need. It
would be easy to set up if my plate always had the same layout, but
that isn't always the case. So essentially I am looking for a way to
tell excel that 2 to n data points are from sample one and to calculate
an average from those 2 to n data points.

Die_Another_Day wrote:
I have no idea what you are asking, but it sounds simple if I can
figure out what you want to do...

Charles

wrote:
I had one more quick question, so if I were to put in the data in
an
array format (8x8, 9x9, etc.) is there any way that I would be able
to
highlight the cells that correspond to compound 1 (say cells 1-4),
compound 2 (5-8), etc. and have the macro calculate averages based
on
this? Sometimes my data will get up to 12x12 and writing a
repetitive
if...then statement covering sample numbers ranging from 1-48 would
be
really tedious. Not sure if there is a way that the you can denote
cells on a template lets say and have excel use the corresponding

cells
for calculations.






All times are GMT +1. The time now is 04:37 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com