VB case Help

  • Thread starter Thread starter jlclyde
  • Start date Start date
J

jlclyde

I have this case and I want the rng to = the Target.value. I had put
in a message box to fire when case 6 happens and it was firing just
fine. It just seems to stop there and not fill rng with
target.value. Any help would be greatly appreciated.

Thanks,
Jay

Select Case Target.Column
Case 6
Dim Rws As Long
Rws = Sheet3.Range("A1").End(xlDown).Row + 1
Set rng = Sheet3.Cells(Rws, 1)
End Select

rng = Target.Value
 
Depending on what's in column A...
rws may be the number of rows in the worksheet PLUS 1

So there would be no sheet3.cells(rws, 1)

If that doesn't help, you may want to post a little more of the code and
describe where the code is located (behind sheet3 maybe???)--and what's in
column A of that sheet.
 
Add a breakpoint to the

Rws = Sheet3.Range("A1").End(xlDown).Row + 1

line and start debugging from there (pressing F8 to execute one line of code
at a time). I imagine the last line you posted is being skipped.

--
Jim
I have this case and I want the rng to = the Target.value. I had put
in a message box to fire when case 6 happens and it was firing just
fine. It just seems to stop there and not fill rng with
target.value. Any help would be greatly appreciated.

Thanks,
Jay

Select Case Target.Column
Case 6
Dim Rws As Long
Rws = Sheet3.Range("A1").End(xlDown).Row + 1
Set rng = Sheet3.Cells(Rws, 1)
End Select

rng = Target.Value
 

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

Back
Top