VBA Macro formatting question

salvadorbali

New Member
Joined
Jul 23, 2015
Messages
2
Dear Excel Pros,

I'm trying to record a macro and there is something in which I would need your advise.
I filtered down one column, and I would like to copy all values from column A to column B.
When I'm doing it manually, I put a =A2 formula in the B2 cell, and drag down the formula until the end of contents.
Obviously, I see where the content ends (usually, this does not cost a lot of scrolling, as my tables contain
no more than 100 lines).
The problem is that I want my VBA to detect automatically where the contents of column A end,
and copy its contents in column B only until that certain point/line.

I already found a formula which detects the end of contecnts a certain column,
but here it's more comlicated, as I need the VBA to detect the end of ANOTHER column, not
the one i'm applying my formula.

Do you have any idea which formula I could use to detect this?


Thanks in advance for any advise!
 
I presume you mean you want something like this:

Code:
a     f
b     g
c     h
d
e

OUTPUT:

Code:
a     f
b     g
c     h
d     a
e     b
      c
      d
      e

Attach a sample spreadsheet, remove any sensitive data.

You cant attach files on this forum.
Upload the file to an online storage site then place a link to it on this forum.
 
Upvote 0
Dear Special-K99,

No, actually I do not have any data in my B column, it is a blank newly inserted column. I only need to copy the (filtered) data from column A.
The problem is only the drill-down. As this is a filtered column, I use the manual drill-down when I'm doing the copy manually.
How can I have the same effect if I want to automate it (with Macro)?

I hope I made myself clear.
 
Upvote 0

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