MrExcel Publishing
Your One Stop for Excel Tips & Solutions

Problem with a variable


Posted by Travis on August 16, 2001 6:32 AM

I am having a hard time setting the variable Rows1

Sub GatherData2()
Dim Title1, Rows1
Title1 = Range("p23")
'Range("p23") currently states Secondary Molding
If Title1 = "Secondary Molding" Then Rows1 = 14

Range("Q19").Select
ActiveCell.FormulaR1C1 = Title1
Range("T19").Select
ActiveCell.FormulaR1C1 = Rows1
'This code is just to check my variables before
I continue with the macro. I can not get Rows1
to equal 14.

End Sub


Posted by Barrie Davidson on August 16, 2001 6:36 AM

Try changing
Title1 = Range("p23")

to:
Title1 = Range("p23").Value

That should do the trick for you.

Barrie

Posted by Travis on August 16, 2001 6:48 AM

Re: Still no output

Try:

ActiveWorkbook.Sheets.Add after:=Worksheets(Worksheets.Count)

HTH

Mark

Posted by Travis on August 16, 2001 7:39 AM

Re: Still not working

Still no output for Rows1???

Posted by Travis on August 16, 2001 7:50 AM

Re: Works good now!

Hi, I was wondering how to change the maximum cell amount in a clumn from 65536 to say 400000.
thanks in advance.

Posted by Barrie Davidson on August 16, 2001 7:52 AM

Travis, problems with this message board....

Your message "Re: Works good now!" is not there. Does it work okay for you??

Barrie