Basic Question about varaibles

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I am trying to use the rows command. I know how to use it if the row is a
number. For example, I know that this would work: rows(1:1)

However I was to use a variable instead of a number. Here is what I have.
It isn't working. Thank you.


Rows("i:i").Delete Shift:=xlUp
 
hi,

this way, it should be OK.

Sub test()
I = 6
johndoe = I & ":" & I
Rows(johndoe).Interior.ColorIndex = 19

End Sub

see ya later
 
Adam

Sub test()
Dim i As Long
i = InputBox("enter a number")
Rows(i).Delete Shift:=xlUp
MsgBox "row " & i & " was deleted"
End Sub
 

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