need help with excel programming

Feeling lonely and want to chat? That's your place to go then. Can't be off-topic enough to not be posted here.

Moderator: Wizards

Post Reply
Message
Author
Phelan
Professional
Posts: 88
Joined: Sun Feb 14, 2010 4:13 pm

need help with excel programming

#1 Post by Phelan » Thu Apr 22, 2010 5:16 am

Hi, maybe some of you guys can help me with some VB programming for Excel 2007.
I have a spreadsheet with two worksheets A and B and I need to copy only the visibles cells from the range A1:A100 on worksheet A to a range starting at A10 on worksheet B.
Thanks in advance.

Olrane
Champion
Posts: 780
Joined: Thu Feb 09, 2006 12:56 am
Location: Illinois

Re: need help with excel programming

#2 Post by Olrane » Thu Apr 22, 2010 10:33 am

As far as I know, just select the desired copy range, copy it, and then paste it in the cell that you want to be the most top-left in the new range.

Whether that works or doesn't, let us know.

Note that I have no experience whatsoever with VB, so I may not even understand what you need. I only understand Excel on a basic level. I can help you make graphs! 8)

Phelan
Professional
Posts: 88
Joined: Sun Feb 14, 2010 4:13 pm

Re: need help with excel programming

#3 Post by Phelan » Fri Apr 23, 2010 3:01 am

I know there is an option that allows you to copy visible cells only, but that works manually. I need some piece of code to insert into my other code that executes several commands when I press a button.

Phelan
Professional
Posts: 88
Joined: Sun Feb 14, 2010 4:13 pm

Re: need help with excel programming

#4 Post by Phelan » Fri Apr 23, 2010 5:27 am

I managed to solved the problem myself, wasn't that hard.

Code: Select all

Sheets("A").Range("A7:A100").SpecialCells(xlCellTypeVisible).Copy
Sheets("B").Range("A10:A110").PasteSpecial Paste:=xlValues

Post Reply