Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Putexcel to a location in Excel adjacent to a cell with a specific value

    I am using putexcel to get a graph into Excel. I want the graph to be adjacent to a cell with a specific value. In other words, how can I use the putexcel command to search for a cell with a specific value? Thanks!!

  • #2
    Long story short, I don't think putexcel is designed for this. Depending on the details of your implementation, you might be able to write the excel data to the file system, read it with import excel, then search for your value that way. That said, you don't give us a lot of details, but it seems like you might have a simpler implementation if you can come up with another way to derive the location of the cell other than searching for a specific value.

    Comment


    • #3
      Originally posted by Daniel Schaefer View Post
      Long story short, I don't think putexcel is designed for this. Depending on the details of your implementation, you might be able to write the excel data to the file system, read it with import excel, then search for your value that way. That said, you don't give us a lot of details, but it seems like you might have a simpler implementation if you can come up with another way to derive the location of the cell other than searching for a specific value.
      I can be more specific, sorry.

      I want to output a p-value from Stata (I know how to do this part) to a specific location in Excel. I want it to go 3 cells to the right from a the variable that I am comparing. Let's call the variable "age". The Excel cell will contain "age". I want the putexcel function to look for "age" in Excel and output to 3 cells to the right.

      Your help is much appreciated!

      Comment


      • #4
        Okay, so you don't actually need to "search" for age (which is good, because searching the document isn't supported). You only need to remember where you put "age" so that you can put something else three cells over. This should be trivial, actually, which makes me wonder if you need something more general. Could you please post your code so far and your example data? Posting code and example data is generally good practice, and more likely to get you a good response.

        Comment

        Working...
        X