zookeepertx
Well-known Member
- Joined
- May 27, 2011
- Messages
- 568
- Office Version
- 365
- Platform
- Windows
I often have to research long sheets of data, which requires filling data in on my research sheet from several different sources. The research sheet has a file # in A and a vendor # in C. The data sources have the file #s & vendor #s in varying columns, but I use a pivot table to end up with file # in A, vendor # in B and the needed data in C.
<?xml:namespace prefix = o ns = "urn:schemas-microsoft-comfficeffice" /><o></o>
The length of the research sheet varies from month to month – often 800-900 rows, so you can imagine how tedious it is to find the correct file #/vendor # combination to plug the data in. (Many of the rows on the research sheet will not have a row on the data source sheet.)
<o></o>
I managed to get an array formula in one of the columns on the research sheet that actually DOES work:
But the problem is that it returns #N/A in any row that doesn’t have any data. This messes up the sum formula in the farthest right column. So, I tried to incorporate an ISERROR in with the formula, but couldn’t get it to work; it left all the cells blank.
<o></o>
In the meantime, I got to thinking that, since there are up to 3 columns requiring data on the research sheet & each column’s data comes from a different source, wouldn’t it be great to have a macro where I could use a couple of Input Boxes: 1 that would let me click on the column where the data NEEDS to go & 1 that would let me tell it (either by typing the worksheet name or by clicking on the worksheet – PREFERRED – where the data come from)!
<o></o>
So, I spent the entire day yesterday trying to make any of that work & can NOT figure it out! I got the macro to pop up the first input box, & can key in the column letter, but clicking OK doesn’t do anything. Yesterday, I had it so I could click OK & the box would go away, but nothing else happened & the second box wouldn’t work right.
<o></o>
THEN, I started trying to figure out how to do an array formula in a macro & my head nearly exploded! I have a terrible time trying to understand written descriptions if they’re in “tech speak”, so it was all greek to me.
<o></o>
Here is all the farther I got with the macro:
<o> </o>
Can anyone help me with this?
<o></o>
Thanks!
<o></o>
Jenny
<?xml:namespace prefix = o ns = "urn:schemas-microsoft-comfficeffice" /><o></o>
The length of the research sheet varies from month to month – often 800-900 rows, so you can imagine how tedious it is to find the correct file #/vendor # combination to plug the data in. (Many of the rows on the research sheet will not have a row on the data source sheet.)
<o></o>
I managed to get an array formula in one of the columns on the research sheet that actually DOES work:
Code:
{=INDEX('Acct Activity'!C$1:C$7,MATCH(A7&C7,'Acct Activity'!A$1:A$7&'Acct Activity'!B$1:B$7,0))}
<o></o>
In the meantime, I got to thinking that, since there are up to 3 columns requiring data on the research sheet & each column’s data comes from a different source, wouldn’t it be great to have a macro where I could use a couple of Input Boxes: 1 that would let me click on the column where the data NEEDS to go & 1 that would let me tell it (either by typing the worksheet name or by clicking on the worksheet – PREFERRED – where the data come from)!
<o></o>
So, I spent the entire day yesterday trying to make any of that work & can NOT figure it out! I got the macro to pop up the first input box, & can key in the column letter, but clicking OK doesn’t do anything. Yesterday, I had it so I could click OK & the box would go away, but nothing else happened & the second box wouldn’t work right.
<o></o>
THEN, I started trying to figure out how to do an array formula in a macro & my head nearly exploded! I have a terrible time trying to understand written descriptions if they’re in “tech speak”, so it was all greek to me.
<o></o>
Here is all the farther I got with the macro:
Code:
Sub ClearingRsch()<o:p></o:p>
' Jenny 10092011<o:p></o:p>
With Application<o:p></o:p>
.ScreenUpdating = False<o:p></o:p>
.EnableEvents = False<o:p></o:p>
.Calculation = xlCalculationManual<o:p></o:p>
.DisplayAlerts = False<o:p></o:p>
End With<o:p></o:p>
<o:p></o:p>
Dim col As Range<o:p></o:p>
Dim source As Range<o:p></o:p>
<o:p></o:p>
Set col = Application.InputBox(Prompt:="Click on column header", _<o:p></o:p>
Title:="Specify Column", Type:=8)<o:p></o:p>
Set source = Application.InputBox(Prompt:="Click on data source sheet", _<o:p></o:p>
Title:="Specify Source", Type:=8)<o:p></o:p>
<o:p></o:p>
<o:p></o:p>
With Application<o:p></o:p>
.ScreenUpdating = True<o:p></o:p>
.EnableEvents = True<o:p></o:p>
.Calculation = xlCalculationAutomatic<o:p></o:p>
.DisplayAlerts = True<o:p></o:p>
End With<o:p></o:p>
<o:p></o:p>
End Sub
Can anyone help me with this?
<o></o>
Thanks!
<o></o>
Jenny