delete a range of data
FelipeCarrillo opened this issue · 4 comments
Hi;
I am going through the excel.link pdf right now and have a question. I found a way to delete an existing excel sheet but can't find a way to delete a range of data within the spreadsheet. Say I want to delete old data from A1:C8 from the active sheet and then re-populate with most recent data. How can I accomplish that?
Thanks for the great package by the way.
Hi,
Clearing range is rather simple (though not very obvious). Just fill range with NA's: xl[a1:c8] = NA
Thanks for the prompt reply. Unable to try it right now but if I don't want 'NA's and I only want to clear the cells, should this xl[a1:a8]="" would do it?
In excel.link
NA's by default are translated to empty cells in Excel. So range will be clear after xl[a1:c8] = NA
. xl[a1:a8]=""
also will do the job. Perhaps you may be interested in cr[a1] = NA
- it will clear the current region (range that will be selected in Excel after pressing Ctrl+Shift+*).
That's great, thanks. cr[a1]=NA is what I was looking for so ranges can dynamically be deleted instead of hard-coding it.