misterspeedy / FsExcel

An F# Excel spreadsheet generator
MIT License
143 stars 18 forks source link

Creating named cells #29

Open sudipto80 opened 2 years ago

sudipto80 commented 2 years ago

How can I create a named cell

Let's say I have a value 0.04 and I put it in B1 but that 0.04 is called "rate" How do I pass in that information toCell [] ? if at all

misterspeedy commented 2 years ago

Hi @sudipto80 - FsExcel doesn't support that right now but it would be a useful feature.

One thing to consider would be whether we support the naming of ranges - maybe not initially.

Naming individual cells should be relatively straightforward to add. Do you want to submit a PR or would you like me to have a go at it? I'm easy either way. It might take me a few days to get to it.

There are some contributor guidelines here: https://github.com/misterspeedy/FsExcel/blob/main/Contributing.md

misterspeedy commented 2 years ago

Looking at doing this now.

misterspeedy commented 2 years ago

Someone has pointed out that we need to consider the scope of names - worksheet or workbook. I'm guessing that most people, most of the time will want to create a worksheet-scoped name (or won't care), so to keep that use-case simple, I propose that we add the following "keywords":

Name name // Creates a worksheet-scoped name

type NameScope = | Worksheet | Workbook
ScopedName(name, scope) // Creates an explicitly-scoped name where scope Worksheet or Workbook
fatim commented 1 year ago

Hi Kit, this can be closed now ?