Advertisement

10.11.2006 at 04:29AM PDT, ID: 22020358
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

6.2

Loop thru and draw values from an inactive sheet (Excel/VBA)

Asked by WileyPowers in Visual Basic Programming

Tags: , , , ,

Hi,

The problem that I can not seem to overcome is that I have a script that has a loop structure that needs to be re-written.

I did not find a way to enclose screen prints or files that could serve to illustrate the structure I got now, and also what the new structure would look like. Hence I will try to describe how it looks in the spreadsheet before I move on to the scripting.

The initial structure that I got now in Excel is the following:

'Main list':

Cell F2: Name3 (read: a company name)
Cell F3: Name1
Cell F4: Name4
Cell F5: Name5
Cell F6: Name2

Cell H2: a from-date
Cell I2: a to-date

Column G: in this column values from the reference list will be put next to the corresponding name, filtered by dates in cells H2 and I2.

'Reference list':

Cell A2: Name1 (read: similar to Name1 in the 'main-list')
Cell A3: Name2
Cell A4: Name1
Cell A5: Name 2

Cell B2: 30.06.2006 (read: from-dates)
Cell B3: 30.06.2006
Cell B4: 20.08.2006
Cell B5: 30.08.2006

Cell C2: 30.08.2006 (read: to-dates)
Cell C3: 30.08.2006
Cell C4: 30.08.2006
Cell C5: 30.09.2006

Cell D2: 500 000
Cell D3: 9 700 000
Cell D4: 2 100 000
Cell D5: 9 700 100

The script I got now will draw values from the 'reference list' and put them into the 'main list' next to the corresponding name, filtered by the two dates (which is given in cells H2 and I2.

As of now the 'main-list' and the 'reference-list' are on the same worksheet, and for this setup I have used the following script:

Sub Period()

InSheet1_FromDate = Range("h2").Value
InSheet1_ToDate = Range("i2").Value

InSheet1_Company = Range("f2").Value
InSheet1_CompanyCellAdress = Range("f2").Address

Range("f65536").Select
Selection.End(xlUp).Select
InSheet1_LastCompanyCellAdress = Selection.Offset(1, 0).Address

Range("f1").Select
InSheet1_StartingPoint = Selection.Address

Range("a65536").Select
Selection.End(xlUp).Select
InSheet2_LastCompanyInReferenceList = Selection.Address


While InSheet1_CompanyCellAdress <> InSheet1_LastCompanyCellAdress

Range(InSheet2_LastCompanyInReferenceList).Select

While InSheet2_CompanyInReferenceList <> "$A$1"

If Selection.Value = Range(InSheet1_CompanyCellAdress).Value Then
If Selection.Offset(0, 1).Value >= InSheet1_FromDate Then
If Selection.Offset(0, 2).Value <= InSheet1_ToDate Then
Range(InSheet1_CompanyCellAdress).Offset(0, 1).Value = Selection.Offset(0, 3).Value
End If
End If
End If

Selection.Offset(-1, 0).Select
InSheet2_CompanyInReferenceList = Selection.Address

Wend

InSheet2_CompanyInReferenceList = Range(InSheet2_LastCompanyInReferenceList).Address
InSheet1_CompanyCellAdress = Range(InSheet1_CompanyCellAdress).Offset(1, 0).Address

Wend

End Sub

(I guess by now I have revealed myself as a novice).

Now, in the new structure the 'reference-list' will maintain the cell references given but it will be placed on a different worksheet than the 'main-list'. In the script above I have indicated which worksheet the variables will refer to. 'InSheet1' refers to the sheet that contains the 'main-list', and 'InSheet2' refers to the worksheet in which the 'reference-list' will be placed.

Could anyone please tell me how to tweak/re-write the script into the new structure (in which the 'reference-list' is placed on a different worksheet , read: Sheet2)? I have given this question 500 points as this has troubled me for quite a while.

Thanks,

Wiley Powers
Start Free Trial
[+][-]10.11.2006 at 06:11AM PDT, ID: 17706524

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]10.11.2006 at 09:48AM PDT, ID: 17708485

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]10.11.2006 at 10:36AM PDT, ID: 17708899

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]10.11.2006 at 11:11AM PDT, ID: 17709218

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]10.11.2006 at 12:03PM PDT, ID: 17709685

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]10.12.2006 at 01:12AM PDT, ID: 17713546

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]10.12.2006 at 03:10AM PDT, ID: 17713941

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]10.12.2006 at 05:29AM PDT, ID: 17714574

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]10.12.2006 at 05:42AM PDT, ID: 17714670

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]10.12.2006 at 06:37AM PDT, ID: 17715146

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]10.12.2006 at 06:57AM PDT, ID: 17715320

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]10.12.2006 at 07:54AM PDT, ID: 17715892

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]10.12.2006 at 08:37AM PDT, ID: 17716288

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]10.12.2006 at 09:15AM PDT, ID: 17716662

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]10.12.2006 at 09:26AM PDT, ID: 17716768

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]10.12.2006 at 09:56AM PDT, ID: 17717058

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]10.13.2006 at 02:36AM PDT, ID: 17722421

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]10.13.2006 at 02:53AM PDT, ID: 17722486

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]10.13.2006 at 03:30AM PDT, ID: 17722612

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]10.13.2006 at 05:51AM PDT, ID: 17723591

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]10.13.2006 at 06:19AM PDT, ID: 17723832

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]10.13.2006 at 06:24AM PDT, ID: 17723869

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]10.13.2006 at 06:47AM PDT, ID: 17724094

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]10.13.2006 at 06:49AM PDT, ID: 17724120

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]10.13.2006 at 07:03AM PDT, ID: 17724232

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zone: Visual Basic Programming
Tags: excel, inactive, range, sheet, vba
Sign Up Now!
Solution Provided By: rorya
Participating Experts: 2
Solution Grade: A
 
 
[+][-]10.16.2006 at 01:38AM PDT, ID: 17737150

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]10.17.2006 at 04:28AM PDT, ID: 17746554

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]10.17.2006 at 05:12AM PDT, ID: 17746821

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
 
Loading Advertisement...
20081112-EE-VQP-42