R cheat code for working with Calsim3 trend reports?

53 views
Skip to first unread message

Barbara Byrne - NOAA Federal

unread,
Jul 9, 2025, 5:53:03 PMJul 9
to Bay-Delta Data Science Fun
I have a Calsim3 trend report. It has multiple tabs with data filling A1 to ET1212. I can use the dashboard tab to generate some outputs I want, but not others. For example, I'd like to be able to pull equivalent columns (by month and year) of output data (e.g. exports, Freeport flows) from multiple scenarios (which are on different tabs of the excel spreadsheet) then do some math with them. I can do the math part, but not sure about how to set things up to pull specific cell ranges from multiple tabs of an excel spreadsheet.

I haven't really done any trial and error yet, thought I'd just ask to see if anyone has this figured out or knows of some good sample code somewhere online.

Thanks,
Barb

--

Barb Byrne
Fish Biologist, California Central Valley Office, West Coast Region
NOAA Fisheries | U.S. Department of Commerce
Google voice #: 916-247-8033

Kyle Broach

unread,
Jul 10, 2025, 1:59:51 PMJul 10
to Bay-Delta Data Science Project Work Team
Hi Barbara,

I'm not sure if you are referring to VBA code or another language. For R, the readxl package has the ability to specify specific sheets and cell ranges. 


So you should be able to create a short script to pull the needed ranges from each sheet and then merge them into a format you need.

Kyle
Reply all
Reply to author
Forward
0 new messages