Copy last column and insert new in excel with formatting

I have a requirement of copying the last column of the excel and insert next to it with existing formatting. I have searched existing answers, couldn’t find any. (I may have slipped some?)

two things:

  1. how to find the last column that has data? (BD in the below image)
  2. Copy entire column and insert new with just formatting and no data (insert into BE with formatting alone but no data)

image

@vvaidya @ddpadil @aksh1yadav @arivu96 any thoughts on approach? Thanks a lot guys.

Isn’t it working with Hotkeys? (ignore if you are not opting this /already tried/too many hot keys)

Check if this retains the format.

  1. Go To A1

  2. Ctrl + right

  3. Right

  4. Ctrl + Space

  5. Shift+Ctrl++(Shift Control plus symbol)

or

  1. Go To A1

  2. Ctrl + right

  3. Ctrl + Space

  4. Ctrl+C

  5. Right

  6. Ctrl+v

  7. Delete

Thanks man. I used a different approach with hotkeys.

  1. I know which cell I have to traverse.
  2. Send hotkey event to call “find cell shortcut” [Ctrl + G]
  3. Enter the cell address and press enter
  4. Send hotkey to select entire column [ctrl + shift + down]
  5. Send hotkey to copy [Ctrl + c]
  6. Go the next column and paste
  7. Delete the contents

CompanyList.xlsx (10.4 KB)
project.json (300 Bytes)
Main.xaml (15.9 KB)

It was quite difficult and I would want to share it with the community, so they can go reuse and improve it. i used the below answer as a base.

Few things (my be your requirement is different) :

You can use f5 instead of Ctrl+g (for go to cell). If your last cell is always static, you can use f5, but if it is dynamic, its better to go to A1 and traverse to last cell (Ctrl+right)

Ctrl+Shift+down doesn’t select entire column, it will select from selected Cell to rest of the column. Ctrl+space selects the entire cell.

You are right. Sometimes it doesn’t work.

Can I ask you, how do I click the excel after it opens? Excel opens up, but the hotkeys and type into isn’t sent to it. It is sent to other open windows in the screen. Is there a way, I can click the excel to bring scope before sending other hotkeys/type into?

The situation is that I have a monitor connected to my laptop. So its an extended screen. Could this be a reason? I tried without that also, its still the same.

Please try bringing the excel to scope by attaching it using activate or attach window activity.