VBA help

huat

New Member
Joined
Jan 8, 2021
Messages
7
Office Version
  1. 2010
Platform
  1. Windows
  2. Mobile
Hi, I have this table that I would like to use VBA to select for each row the last available column K or L. I tried to record a VBA but when the active cell is at A2, I pressed Ctrl and right arrow keys, it will go to N2. I had actually wanted to go to L2 so that I can select L2 and copy to paste to another worksheet. But when the active cell is at A3, pressing Ctrl and right arrow keys will go to K3 instead of N3, which is what I wanted. Pls help. Thanks.
IMG_20211229_135939.jpg
 

Excel Facts

Select a hidden cell
Somehide hide payroll data in column G? Press F5. Type G1. Enter. Look in formula bar while you arrow down through G.
The reason it went to N2 instead of L2 perhaps because you probably has a space in M2. Try Del anything in M2.

Even if you have VBA, how do you want to initiate action to go to last column with data? You can just easily use Ctrl+Arrow Right :unsure:
 
Upvote 0
Solution
The reason it went to N2 instead of L2 perhaps because you probably has a space in M2. Try Del anything in M2.

Even if you have VBA, how do you want to initiate action to go to last column with data? You can just easily use Ctrl+Arrow Right :unsure:
Thanks Zot for your reply. I'm away from office now. I will see if there's really something there in M2 tomorrow. I'm using VBA because I will need to copy the last column of the data every month and paste it to another worksheet, so wanting to automate it to save time. Thanks
 
Upvote 0
Thanks Zot for your reply. I'm away from office now. I will see if there's really something there in M2 tomorrow. I'm using VBA because I will need to copy the last column of the data every month and paste it to another worksheet, so wanting to automate it to save time. Thanks
Yes. I'd automate if it is repetitive routine even monthly but in order to get helpers' help here you need to provide how your data source and destination sheet laid out.
 
Upvote 0
I've deleted the space at M2 and the problem is now solved. Thanks.
 
Upvote 0

Forum statistics

Threads
1,214,901
Messages
6,122,157
Members
449,068
Latest member
shiz11713

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top