+ Reply to Thread
Results 1 to 12 of 12

read column row by row and reference to different sheet

  1. #1
    Registered User
    Join Date
    07-30-2012
    Location
    Norfolk, Virginia
    MS-Off Ver
    Excel 2007
    Posts
    14

    read column row by row and reference to different sheet

    I am trying to write a code that looks down a column on one sheet and uses the cell value to reference a different sheet. Then take the adjacent cell value on the new sheet and place in power point. here is some of the code I have worked on. I have also attatched the workbook that it will be running in. Andrew coding practicemacro.xlsm

    Please Login or Register  to view this content.

  2. #2
    Forum Expert Tinbendr's Avatar
    Join Date
    06-26-2012
    Location
    USA
    MS-Off Ver
    Office 2010
    Posts
    2,125

    Re: read column row by row and reference to different sheet

    Quote Originally Posted by petebmor View Post
    Then take the adjacent cell value on the new sheet
    What are you talking about?

    Can you give a real example?
    David
    (*) Reputation points appreciated.

  3. #3
    Registered User
    Join Date
    07-30-2012
    Location
    Norfolk, Virginia
    MS-Off Ver
    Excel 2007
    Posts
    14

    Re: read column row by row and reference to different sheet

    an example would be using the code com1 from the responses sheet and then finding it on the questions sheet. Once found taking the cell from column g of the same row and placing it in powerpoint. is that more clear?

  4. #4
    Forum Expert Tinbendr's Avatar
    Join Date
    06-26-2012
    Location
    USA
    MS-Off Ver
    Office 2010
    Posts
    2,125

    Re: read column row by row and reference to different sheet

    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    07-30-2012
    Location
    Norfolk, Virginia
    MS-Off Ver
    Excel 2007
    Posts
    14

    Re: read column row by row and reference to different sheet

    what variable are you using as the question string?

  6. #6
    Registered User
    Join Date
    07-30-2012
    Location
    Norfolk, Virginia
    MS-Off Ver
    Excel 2007
    Posts
    14

    Re: read column row by row and reference to different sheet

    everything is perfect but i cant get it to grab the question information. I get a output of either the cell location or the cell value like def2 com3. how do i take that piece of information and get it to grab the whole question. it is in sheet question-all column G.

  7. #7
    Forum Expert Tinbendr's Avatar
    Join Date
    06-26-2012
    Location
    USA
    MS-Off Ver
    Office 2010
    Posts
    2,125

    Re: read column row by row and reference to different sheet

    When the search looks for a match on the Questions-All sheet, C will reference the found text. (COM1)

    From there, you use offset to reference the column over to the question.

    C.Offset(, 4).Value

  8. #8
    Registered User
    Join Date
    07-30-2012
    Location
    Norfolk, Virginia
    MS-Off Ver
    Excel 2007
    Posts
    14

    Re: read column row by row and reference to different sheet

    i just get the same output when it runs. looks like it runs through all the questions and doesnt pick just one and then step through the next ones. it always puts out the same answer.

    could this becaused by the fact that i am pulling graphs at the same time?

    Please Login or Register  to view this content.

  9. #9
    Forum Expert Tinbendr's Avatar
    Join Date
    06-26-2012
    Location
    USA
    MS-Off Ver
    Office 2010
    Posts
    2,125

    Re: read column row by row and reference to different sheet

    I'm still not quite sure what you're looking for... all the questions associated with the responses? But I'm still not clear how that correlates to the graphs.

    But try this

    Qest = Qest & C.Offset(, 4).Value & vbcr

  10. #10
    Registered User
    Join Date
    07-30-2012
    Location
    Norfolk, Virginia
    MS-Off Ver
    Excel 2007
    Posts
    14

    Re: read column row by row and reference to different sheet

    Thank you for your patience.

    the macro is used to calculate survey data. the question is asked and the responses are given (1-5)

    on the first sheet the responses are imputed.

    the macro then takes the data creates graphs and moves those graphs and the original question to a powerpoint for presentation purposes. so the question and the graph is on the same slide of the powerpoint.

    so the first sheet has the info of what question was asked and the responses each "person" gave.

    Qest = Qest & C.Offset(, 4).Value & vbcr is close now it takes all the quesitons in sheet1 column 1

  11. #11
    Forum Expert Tinbendr's Avatar
    Join Date
    06-26-2012
    Location
    USA
    MS-Off Ver
    Office 2010
    Posts
    2,125

    Re: read column row by row and reference to different sheet

    Sorry for being dense. So each Bar chart is the responses to one question? And we need to find the corresponding question and insert that on the slide?

    In the sample you u/l, there are responses to Question 1-9, 11 & 13. So then, do we need to pull only these questions?

    Can you also u/l a finished Powerpoint result of what you expect? Maybe Q1-5.

    I think you have two loops and you should only have one. Either the responses or the charts, but not both.

  12. #12
    Registered User
    Join Date
    07-30-2012
    Location
    Norfolk, Virginia
    MS-Off Ver
    Excel 2007
    Posts
    14

    Re: read column row by row and reference to different sheet

    all of the questions will have a question number eventually. so question 1-33 will have a question number. but the number of questions will change.

    i think you are right if i have one loop this will be easier. ill post back what i come up with

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1