ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Assignment Statement (https://www.excelbanter.com/excel-programming/275614-assignment-statement.html)

Richard Daniels

Assignment Statement
 
Hi

Unless you have decalred Tom somewhere as a variable or
constant and set the value the code will not work.

If you intended to test if the name was = Tom, put Tom is
quotes, ie "Tom"


-----Original Message-----
Hi,
Please correct the code below:

Sub ChangeBoy()
Range("SelectedBoy").Value = Sheets("Sheet1").Range
("Boys") & Range("SelectedBoyRow")
If Range("SelectedBoy") = Tom Then
Range("A2:A10").Select
End If
End Sub

It has been a long time since I programmed using VBA,

and
I was never good at it either. My help files have not

been
installed. I appreciate any help.

Thanks,
Sisilla
.



All times are GMT +1. The time now is 01:39 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com