Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Insert row and column functions #80

Closed
rkpatel33 opened this issue Oct 3, 2014 · 21 comments · Fixed by #1211
Closed

Insert row and column functions #80

rkpatel33 opened this issue Oct 3, 2014 · 21 comments · Fixed by #1211
Labels
Milestone

Comments

@rkpatel33
Copy link

@rkpatel33 rkpatel33 commented Oct 3, 2014

No description provided.

@bklaas

This comment has been minimized.

Copy link

@bklaas bklaas commented Nov 9, 2015

There's no description to this issue, but I'm assuming the wording means "add functions to xlwings to enable insert-column and insert-row actions on the spreadsheet". If that's the intention of the issue, +1 to this one.

@rkpatel33

This comment has been minimized.

Copy link
Author

@rkpatel33 rkpatel33 commented Nov 9, 2015

+1

Apologies for the brevity, I thought it was self-explanatory.

@Diego-MX

This comment has been minimized.

Copy link

@Diego-MX Diego-MX commented Dec 7, 2015

I started using xlwings and am looking forward to get the most out of it, and to contribute back to the project as well. A question that I had on this feature is if it's possible to insert a range of cells; and also to delete a range of cells.

@fzumstein

This comment has been minimized.

Copy link
Member

@fzumstein fzumstein commented Dec 7, 2015

You're talking about copying some Range, then inserting that, correct? Sure, whatever VBA supports should be implementable.

@Diego-MX

This comment has been minimized.

Copy link

@Diego-MX Diego-MX commented Dec 7, 2015

Thank you for your answer. My issue results from a selection that may not represent the whole table; it may have more cells below the actual selection. So when copying the data, I also need to shift up whatever is below, and when pasting I also need to make sure that it won't override anything from below.

In VBA I saw it can be done as Selection.Insert Shift:=xlDown and Selection.Delete Shift:=xlUp

@fzumstein

This comment has been minimized.

Copy link
Member

@fzumstein fzumstein commented Dec 7, 2015

Sure makes sense, we should take care of that when we get to it!

@Diego-MX

This comment has been minimized.

Copy link

@Diego-MX Diego-MX commented Dec 7, 2015

Thanks.

@sanghunka

This comment has been minimized.

Copy link

@sanghunka sanghunka commented Apr 28, 2016

+1
It would be very helpful

@puruzio

This comment has been minimized.

Copy link

@puruzio puruzio commented Oct 27, 2016

+1

@y2kbugger

This comment has been minimized.

Copy link
Contributor

@y2kbugger y2kbugger commented Jan 13, 2017

Still looking for this.

@Elijas

This comment has been minimized.

Copy link

@Elijas Elijas commented Mar 11, 2017

+1

1 similar comment
@yejiawei1234

This comment has been minimized.

Copy link

@yejiawei1234 yejiawei1234 commented Jun 13, 2017

+1

@Elijas

This comment has been minimized.

Copy link

@Elijas Elijas commented Jun 14, 2017

For anyone wondering - a workaround is to access the native VBA API through excel wings exposed api property of xlwings objects

@mlntr

This comment has been minimized.

Copy link

@mlntr mlntr commented Jul 27, 2017

@Elijas Can you elaborate on how to do that?

@y2kbugger

This comment has been minimized.

Copy link
Contributor

@y2kbugger y2kbugger commented Jul 27, 2017

Look here for a quick tutorial on how to do that:
http://docs.xlwings.org/en/stable/missing_features.html

@HartBlanc

This comment has been minimized.

Copy link

@HartBlanc HartBlanc commented Oct 14, 2017

+1

1 similar comment
@manobeeslaar

This comment has been minimized.

Copy link

@manobeeslaar manobeeslaar commented May 29, 2019

+1

@fzumstein fzumstein added this to the 0.15.9 milestone May 29, 2019
@fzumstein

This comment has been minimized.

Copy link
Member

@fzumstein fzumstein commented May 30, 2019

on Windows, this is:

from xlwings.constants import InsertShiftDirection
wb.sheets[0].range("A1").api.Insert(InsertShiftDirection.xlShiftDown)

alternatively, InsertShiftDirection.xlShiftToRight

@manobeeslaar

This comment has been minimized.

Copy link

@manobeeslaar manobeeslaar commented May 30, 2019

Is there a alternative in MAC as well or is this only for Windows...

@fzumstein

This comment has been minimized.

Copy link
Member

@fzumstein fzumstein commented May 30, 2019

yes but I'll need more time to figure out the syntax. As a quick note the MacScript is:

tell application "Microsoft Excel"
	insert into range column 3 of sheet 1
end tell
@fzumstein

This comment has been minimized.

Copy link
Member

@fzumstein fzumstein commented Jun 1, 2019

on mac it is:

wb.sheets[0].api.columns[1-based-index].insert_into_range()
@fzumstein fzumstein modified the milestones: 0.15.9, 0.15.10 Aug 31, 2019
@fzumstein fzumstein added this to the 0.16.1 milestone Oct 13, 2019
@fzumstein fzumstein modified the milestones: 0.16.1, 0.16.2 Dec 1, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
You can’t perform that action at this time.