Entering value into cell in macro

T

TD

Hi,

I've got several macrobuttons that hide rows in sheet 2 so that only certain
cells can be filled in eg Row 16 will be hidden. When this option is chosen
row 16 is not filled in and in C25 even rows C2-C20 will be summed. C16 is
still in this formula but because it is empty it doesn't add anything. At
this stage I'm not worrying about C16 getting filled in and then option to
hide it is selected - hmm trouble for later methinks-

C27 has the formula C25/10 but I thought that I could use H1 which will be a
hidden cell C25/H1. The plan was to put a value for H1 into each of the
macros which hide different rows.

I'm very much a newbie - limited to record, fiddle copy from the net so any
help appreciated
Thank you
 
P

paul.robinson

Hi
not sure if this is all you want but

Activesheet.Range("H1").Value = 10

will put 10 in cell H1. On the sheet "MySheet"

Worksheets("MySheet").Range("H1").Value = 10

If you have a variable called MyVar in a macro which might take the
value 10 then

Dim MyVar as integer 'or double, long etc
Worksheets("MySheet").Range("H1").Value = MyVar

regards
Paul
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top