value of variables do not show when I hover.

  • Thread starter Thread starter JSnader
  • Start date Start date
J

JSnader

When I step through my code using F8, "tooltip." do not show the value of my
variables when I hover over them.
I think the value of SalesFlock and ws.Name should show when I've stepped
past them, and then hover.

The following code should find the correct sheet and add the information to
the bottom of the list.

SalesFlock = ActiveCell.Text

Dim ws As Worksheet
For Each ws In Worksheets
If ws.Name = SalesFlock Then
ws.Select
Range("w1").Select

Do While ActiveCell.Value <> ""
ActiveCell.Offset(1, 0).Select
Loop

Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False

Exit For
End If
Next ws
 
Hovering doesn't always work; try highlighting the variable and using
<Shift> <F9>.
 
I never step through my code or set watch variables, so I am afraid I can't
be of much help there.

If you want to paste to the first blank cell after cell W1 in the sheet with
the name in the activeCell.

Dim rng as Range, rng1 as Range
on Error Resume Next
set rng = Worksheets(ActiveCell.Value).Range("W1")
On Error goto 0
if rng is nothing then
msgbox "No sheet named " & activeCell.Value
Exit sub
End if
if isempty(rng) then
set rng1 = rng
elseif isempty(rng.offset(1,0)) then
set rng1 = rng.offset(1,0)
else
set rng1 = rng.End(xldown).Offset(1,0)
End if
rng1.PasteSpecial Paste:=xlPasteValues, _
Operation:=xlNone, _
SkipBlanks:=False, _
Transpose:=False
 
Back
Top