Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 76
Default Paradox then paste into excel

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

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 76
Default Paradox then paste into excel

Hello from Steved

Private Sub Worksheet_SelectionChange(ByVal Target As
Range)

The above works by moving the cursor over say City it then
changes it to 1-City, so I believe I am getting there,
just need it to to as I paste into Excel workSheet.
Cheers.

-----Original Message-----
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

.

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Paradox then paste into excel

You don't need a macro

After you paste your data, select your data, then do

Edit=Replace
Find what: City
Replace With: 1-City

select Find Entire Cells Only

--
Regards,
Tom Ogilvy

"Steved" wrote in message
...
Hello from Steved

Private Sub Worksheet_SelectionChange(ByVal Target As
Range)

The above works by moving the cursor over say City it then
changes it to 1-City, so I believe I am getting there,
just need it to to as I paste into Excel workSheet.
Cheers.

-----Original Message-----
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

.



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,824
Default Paradox then paste into excel

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

  #5   Report Post  
Posted to microsoft.public.excel.programming
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

.



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Paradox then paste into excel

Probably a mistake to go that way. Using Replace will be much, much faster

Public Sub ChangeAll()
varr = Array("City", "Roskill", "Papakura", "Wiri", _
"North Shore", "Orewa", "Swanson", "Panmure", _
"Waiheke")
varr1 = Array("1-City", "2-Rosk", "3-Papa", "4-Wiri", _
"5-Shor", "7-Swan", "8-Panm", "9-Waih")

for i = lbound(varr) to ubound(varr)
Columns(1).Replace What:=varr(i), _
Replacement = varr1(i), _
Lookat:=xlWhole, SearchOrder:=xlByRows, _
MatchCase:=False
Next
End Sub

This assumes the content of the cells to be changed contain only one of the
test words. (not every cell in column A).

--
Regards,
Tom Ogilvy


"Steved" wrote in message
...
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

.



  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 76
Default Paradox then paste into excel

Thanks Tom.

-----Original Message-----
Probably a mistake to go that way. Using Replace will

be much, much faster

Public Sub ChangeAll()
varr = Array("City", "Roskill", "Papakura", "Wiri", _
"North Shore", "Orewa", "Swanson", "Panmure", _
"Waiheke")
varr1 = Array("1-City", "2-Rosk", "3-Papa", "4-Wiri", _
"5-Shor", "7-Swan", "8-Panm", "9-Waih")

for i = lbound(varr) to ubound(varr)
Columns(1).Replace What:=varr(i), _
Replacement = varr1(i), _
Lookat:=xlWhole, SearchOrder:=xlByRows, _
MatchCase:=False
Next
End Sub

This assumes the content of the cells to be changed

contain only one of the
test words. (not every cell in column A).

--
Regards,
Tom Ogilvy


"Steved" wrote in

message
...
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

.



.

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Excel to Word : Paste specialPaste Link Excel Chart Obj doesn't Makedon Charts and Charting in Excel 0 January 12th 10 08:56 PM
Excel 2007 Pivot Table from a Paradox File Erika Excel Discussion (Misc queries) 0 April 27th 09 03:57 PM
Paste and Paste Special No Longer Working - Excel 2003 SheriJ Excel Discussion (Misc queries) 2 January 15th 09 09:23 PM
data from Paradox to Excel Kev SCL Setting up and Configuration of Excel 2 July 3rd 06 03:29 AM
import paradox database into excel fange Excel Discussion (Misc queries) 1 August 19th 05 03:20 PM


All times are GMT +1. The time now is 04:37 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"