HP Forums
Spreadsheet app insert column - Printable Version

+- HP Forums (https://www.hpmuseum.org/forum)
+-- Forum: HP Calculators (and very old HP Computers) (/forum-3.html)
+--- Forum: HP Prime (/forum-5.html)
+--- Thread: Spreadsheet app insert column (/thread-8524.html)



Spreadsheet app insert column - KeithB - 06-18-2017 04:12 PM

Is there a way to insert a column? Nothing obvious comes up when I highlight the heading.


RE: Spreadsheet app insert column - Arno K - 06-18-2017 07:20 PM

Simply enter for example "=Row^2", that is the way to enter formulas for a whole column.
Arno


RE: Spreadsheet app insert column - KeithB - 06-19-2017 12:09 AM

Not really what I want. I have an existing sheet and I need to add a column between two existing ones. Eg, I have net and "purchase price" and I want to put "additional" and "down payment" between them.


RE: Spreadsheet app insert column - cyrille de brébisson - 06-19-2017 09:13 AM

Hello,
Unfortunately, there is no easy way to do so...

The easiest might be a copy/paste operation

Cyrille


RE: Spreadsheet app insert column - KeithB - 06-22-2017 10:25 PM

(06-19-2017 09:13 AM)cyrille de brébisson Wrote:  Hello,
Unfortunately, there is no easy way to do so...

The easiest might be a copy/paste operation

Cyrille

copy and paste did not seem to work with the formulas. I ended up just recreating the whole darn thing.


RE: Spreadsheet app insert column - cyrille de brébisson - 06-26-2017 06:14 AM

hello,

Sorry, yes, formulas don't get updated.

Cyrille


RE: Spreadsheet app insert column - roadrunner - 06-26-2017 10:45 PM

You can use the programs below to insert and delete columns:

PHP Code:
EXPORT InsertCol(c)
BEGIN
 local rs
,cs;
 
rs:=SIZE(A:A);
 
cs:=SIZE(1:1);
 FOR 
I FROM c TO cs DO
  FOR 
J FROM 1 TO rs DO
   
Cell(J,cs-I+c+1,−1):=Cell(J,cs-I+c,−1);
  
END;
 
END;
 FOR 
J FROM 1 TO rs DO
  
Cell(J,c,−1):=Cell(J,cs+1,−1);
 
END;
 
"all done";
END;

EXPORT DeleteCol(c)
BEGIN
 local rs
,cs;
 
rs:=SIZE(A:A);
 
cs:=SIZE(1:1);
 FOR 
I FROM c TO cs DO
  FOR 
J FROM 1 TO rs DO
   
Cell(J,I,−1):=Cell(J,I+1,−1);
  
END;
 
END;
 
"all done";
END

Example: If you want to insert a column at B just go to the home or cas view and type InsertCol(2). Similar for DeleteCol.

I'm working on a similar method to insert and delete rows.

Eventually, as time permits, I plan to use the Curser variable to locate where to insert or delete, and hijack the plot key to display a pop up menu asking how many rows or columns.

-road