Questions tagged [worksheet]

Worksheet is an Excel worksheet. It consists of cells filled with data. Choose this tag if the problem you have involves working with the Worksheet object. If you use this tag, you probably should also use Excel and VBA (or the language you use) tags.

According to Wikipedia article, a worksheet is a sheet of paper, or on a computer, on which problems are worked.

Worksheets in Excel are very powerful but simple and convenient objects that can be used in a plenty of ways. They became de-facto industrial and business standard. For example, credit plan sheets are usually developed in Excel worksheets.

Also, they are used in science and education for the ability to be combined with diagrams and charts, which can also be accessed through Sheets object.

Worksheet has underlying programming object of the same name which has access to all of it's built-in features and functions.

1217 questions
76
votes
8 answers

How to add a named sheet at the end of all Excel sheets?

I am trying to add an Excel sheet named "Temp" at the end of all existing sheets, but this code is not working: Private Sub CreateSheet() Dim ws As Worksheet ws.Name = "Tempo" Set ws = Sheets.Add(After:=Sheets(Sheets.Count)) End Sub Can…
Behseini
  • 6,066
  • 23
  • 78
  • 125
46
votes
4 answers

xlsxwriter: is there a way to open an existing worksheet in my workbook?

I'm able to open my pre-existing workbook, but I don't see any way to open pre-existing worksheets within that workbook. Is there any way to do this?
Nick
  • 485
  • 1
  • 4
  • 3
39
votes
9 answers

C#: Getting the number of rows/columns with ExcelPackage

I need to read and write data from an Excel spreadsheet. Is there a method to finding out how many rows/columns a certain worksheet has using ExcelPackage? I have the following code: FileInfo newFile = new FileInfo(@"C:\example.xlsx"); using…
Napoli
  • 549
  • 2
  • 8
  • 13
34
votes
18 answers

Copy sheet and get resulting sheet object?

Is there any easy/short way to get the worksheet object of the new sheet you get when you copy a worksheet? ActiveWorkbook.Sheets("Sheet1").Copy after:=someSheet It turns out that the .Copy method returns a Boolean instead of a worksheet object.…
Rabarberski
  • 23,854
  • 21
  • 74
  • 96
26
votes
3 answers

Reference excel worksheet by name?

I have the name of a worksheet stored as a string in a variable. How do I perform some operation on this worksheet? I though I would do something like this: nameOfWorkSheet = "test" ActiveWorkbook.Worksheets(nameOfWorkSheet).someOperation() How do…
Jonson Bylvaklov
  • 905
  • 3
  • 9
  • 18
24
votes
6 answers

Copying Excel Worksheets in POI

Does anyone know of a means to copy a worksheet from one workbook to another using POI? The Workbook class has a cloneSheet method, but there doesn't seem to be able to insert a cloned sheet into a new workbook? If there isn't an API to do this…
Patrick Nichols
24
votes
6 answers

How to setup Intellij 14 Scala Worksheet to run Spark

I'm trying to create a SparkContext in an Intellij 14 Scala Worksheet. here are my dependencies name := "LearnSpark" version := "1.0" scalaVersion := "2.11.7" // for working with Spark API libraryDependencies += "org.apache.spark" %% "spark-core" %…
rburg
  • 283
  • 3
  • 7
24
votes
9 answers

C# - How to add an Excel Worksheet programmatically - Office XP / 2003

I am just starting to fiddle with Excel via C# to be able to automate the creation, and addition to an Excel file. I can open the file and update its data and move through the existing worksheets. My problem is how can I add new sheets? I…
Jon
  • 15,110
  • 28
  • 92
  • 132
23
votes
6 answers

System.drawing.common the type initializer for 'gdip' threw an exception

This is my code to add a picture to a worksheet. I get the picture as a byte from the database. .Net Core framework version is 2.2.104. This is an API project. In my locale, the code works well. I use the ClosedXML component 0.95.4 version as…
Ömer Yalvaç
  • 231
  • 1
  • 2
  • 3
22
votes
11 answers

How to copy worksheet from one workbook to another one using openpyxl?

I have a large amount of EXCEL files (i.e. 200) I would like to copy one specific worksheet from one workbook to another one. I have done some investigations and I couldn't find a way of doing it with Openpyxl This is the code I have developed so…
idillus
  • 221
  • 1
  • 2
  • 3
22
votes
10 answers

Excel tab sheet names vs. Visual Basic sheet names

It seems that Visual Basic can not reference sheets according to user-modified sheet names. The worksheet tabs can have their names changed, but it seems that Visual Basic still thinks of the worksheet names as Sheet1, etc., despite the workbook tab…
22
votes
4 answers

Excel VBA For Each Worksheet Loop

I am working on code to basically go through each sheet in my Workbook, and then update column widths. Below is the code I wrote; I don't receive any errors, but it also doesn't actually do anything. Any help is greatly appreciated! Option…
Dakota
  • 464
  • 3
  • 7
  • 19
21
votes
3 answers

scala - error: not found: value

I newly at scala and tried to pass some easy scala worksheet. IDE is Intellij IDEA community edition and OS Ubuntu 12.04, sbt was installed correctly. But it throws error - error: not found: value OI can't understand why this happen: Code: object…
catch23
  • 17,519
  • 42
  • 144
  • 217
19
votes
3 answers

Looping through worksheets with PHPExcel

I'm using the PHPExcel library to read an Excel file and perform processing on it. I want to loop through each worksheet. I checked the documentation and all I could find was changing the active worksheet index or only loading specified…
user717236
  • 4,959
  • 19
  • 66
  • 102
18
votes
4 answers

VBA Worksheet change event bypass?

I am fixing a spreadsheet. The programmer made a macro for each sheet to fire when the sheet is changed. This is good because it colour co-ordinates the sheet details when new information is added so I would like to keep this feature. I have written…
user1545643
  • 313
  • 1
  • 4
  • 10
1
2 3
80 81