mattchoo87
New Member
- Joined
- Sep 3, 2014
- Messages
- 3
Hi all, I'm very new to VBA but trying my hand at my first form. I've searched for a couple of hours an can't seem to fix this so here I am....
What I have done so far is create a form with a textboxes which relates to an upper limit for which I want to base my changes in the active cell.
I have the form initialize with
MAMtext.Value = 1
Then, I take some data in column A and run a text to columns on it via the userform macro OK button
Next step is to take that textbox value (1) and use it to see if my activecell is greater than it starting at C4:
Range("C4").Select
Do While ActiveCell.Value <> ""
If ActiveCell.Value > MAMtext.Value Then ActiveCell.Value = "DETSAT"
ActiveCell.Offset(1, 0).Select
Loop
and so on until all values above 1 have been changed to DETSAT.
When I step in the macro, everything looks fine (MAMtext.Value displays as "1" though?), but it doesn't then change my activecell to DETSAT as the loop cycles...
When I try the line in the immediate window it seems to work fine.
What am I missing? I'm sure it is something simple!
Thanks in advance!
Matt
What I have done so far is create a form with a textboxes which relates to an upper limit for which I want to base my changes in the active cell.
I have the form initialize with
MAMtext.Value = 1
Then, I take some data in column A and run a text to columns on it via the userform macro OK button
Next step is to take that textbox value (1) and use it to see if my activecell is greater than it starting at C4:
Range("C4").Select
Do While ActiveCell.Value <> ""
If ActiveCell.Value > MAMtext.Value Then ActiveCell.Value = "DETSAT"
ActiveCell.Offset(1, 0).Select
Loop
and so on until all values above 1 have been changed to DETSAT.
When I step in the macro, everything looks fine (MAMtext.Value displays as "1" though?), but it doesn't then change my activecell to DETSAT as the loop cycles...
When I try the line in the immediate window it seems to work fine.
What am I missing? I'm sure it is something simple!
Thanks in advance!
Matt