View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Steved[_3_] Steved[_3_] is offline
external usenet poster
 
Posts: 76
Default Paradox then paste into excel

Gentleman Thankyou.

Tom in my case I have 9 cities with over 4,000 rows
I put in a example to to explain as to what i require as
for the other Ciies I will use Dave VBA and build it.

Thankyou both again, you have saved me a lot of time

Cheers.

-----Original Message-----
How about:

Option Explicit
Private Sub Worksheet_Change(ByVal Target As Range)

Dim myCell As Range

On Error GoTo ws_exit
Application.EnableEvents = False
For Each myCell In Target.Cells
If UCase(Left(myCell.Text, 4)) = "CITY" Then
myCell.Value = "1-City"
End If
Next myCell

ws_exit:
Application.EnableEvents = True
End Sub

Steved wrote:

Hello from Steved. Please is the below possible.
The below VBA will allow me to type City and it will
change to 1-City. Can the below be taken one step

further,
I copy from Paradox then paste into excel worksheet

which
has the below VBA. Is it possible when I paste it from
Paradox into the excel worksheet it will find City then
change it to 1_City.

Thankyou.

Private Sub Worksheet_Change(ByVal Target As Range)
Application.EnableEvents = False
On Error GoTo ws_exit
With Target
Select Case UCase(Left(.Value, 4))
Case "CITY": .Value = "1-City"
End Select
End With

ws_exit:
Application.EnableEvents = True
End Sub


--

Dave Peterson

.