Print certain cells in Excel

  • Dannies
  • Born
  • Born
  • User avatar
  • Posts: 1

Post 3+ Months Ago

Hi, first time on this forum, and I start with a question. I want to make a button in Excel in front of every row so if a press on it, that it will print out certain cells in that row. How do i do that? I use Excel 97. Thank you for your help.
  • Anonymous
  • Bot
  • No Avatar
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post 3+ Months Ago

  • Ragnar78
  • Proficient
  • Proficient
  • Ragnar78
  • Posts: 279

Post 3+ Months Ago

Do you know how to program VBA?
Do you know how to record macros?

In your module you should set condition on the range that should be selected...

For example:

I=1
While Range("A" & cstr(I)) <> ""
Range("A1:A" & cstr(I)).select
I=I+1
Wend


Now this small peice of VBA will select all the cells that contains data and stop selecting when a cell is empty

Then set this peice of code after it:

Selection.PrintOut Copies:=1, Collate:=True
it should print the selected cells...

Create a button and assign to it the name of the module or sub

ps: in macros you cannot do a multiple select like select Cell C1 and A5 and G6 and print them..

Post Information

  • Total Posts in this topic: 2 posts
  • Users browsing this forum: No registered users and 51 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.