Problems selecting ranges in XL

Status
This thread has been Locked and is not open to further replies. The original thread starter may use the Report button to request it be reopened but anyone else with a similar issue should start a New Thread. Watch our Welcome Guide to learn how to use this site.

Mikehogan

Thread Starter
Joined
Nov 12, 2001
Messages
2
I'm having problems with recognising a range, I basically want XL to paste copied info dependent upon data type.

I have this as a simple eg.

K3 = a
K4 = b
K5 = c



Range("K3:K5").Select
Selection.Copy
If Range("K3" = "a") Then
Range("L5").Select
End If
If (ActiveCell = "") Then
ActiveSheet.Paste
End If
End Sub

I can't get it to recognise the contents of the target cell (K3), therefore cannot continue with the task.

Please advise!

Thanks

Mike


:(
 
Joined
Nov 30, 2000
Messages
436
Mike,
I used your code and found that it was mostly syntax overkill. I called it "abc" and made it work this way. Hope this is what you want.

Sub abc()
Range("K3:K5").Select
If (ActiveCell = "a") Then
Selection.Copy
range("L5").Select
If (ActiveCell = "") Then
ActiveSheet.Paste
End If
End If
End Sub

Drew
 
Status
This thread has been Locked and is not open to further replies. The original thread starter may use the Report button to request it be reopened but anyone else with a similar issue should start a New Thread. Watch our Welcome Guide to learn how to use this site.

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 807,865 other people just like you!

Latest posts

Members online

No members online now.
Top