Question: Iinstalled oracle in my Windows 10 64 bit pc and I started doing verification steps mentioned in the tutorial which's given in the oracle website which can be found in the link below.

<http://www.oracle.com/webfolder/technetwork/tutorials/obe/db/12c/r1/Windows_DB_Install_OBE/Installing_Oracle_Db12c_Windows.html>

When I try to connect to my pluggable database using this command 

```
C:\Users\Chathura>sqlplus sys/Oracle_1@orclpdb as sysdba;

```

it gives me following message 

```
SQL*Plus: Release 12.2.0.1.0 Production on Tue Jan 30 19:34:25 2018

Copyright (c) 1982, 2016, Oracle.  All rights reserved.

ERROR:
ORA-12154: TNS:could not resolve the connect identifier specified

Enter user-name:

```

But when I try to connect to container database it connects successfully.

This is how I created pluggable database.

[![enter image description here](https://i.stack.imgur.com/I1sFE.jpg)](https://i.stack.imgur.com/I1sFE.jpg)

I read articles regarding this tried adding TNS\_ADMIN system variable too, but non of those worked. 
What I am doing wrong here?

Answer: 
This does not use a second column and does all the values in Column C. It moves the values to an array, iterates the array and trims the excess space and overwrites the values in C with the array.

```
Sub macro1()
Dim rng As Variant
Dim ws As Worksheet
Dim i As Long

Set ws = Worksheets("Sheet1") 'Change to your sheet name.

With ws
    rng = .Range("C1", .Cells(.Rows.Count, 3).End(xlUp)).Value
    For i = LBound(rng) To UBound(rng)
        rng(i, 1) = Application.Trim(rng(i, 1))
    Next i
    .Range("C1", .Cells(.Rows.Count, 3).End(xlUp)).Value = rng
End With
End Sub

```
Change the code like this so you don't use `Select`. Using `Select` and `Selection` slows everything down horribly.

```
Sub Macro1()
    Range("D1").FormulaR1C1 = "=TRIM(RC[-1])"
    Range("D1").AutoFill Destination:=Range("D1:D4")
    Columns("D:D").Copy
    Range("C1").PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
        :=False, Transpose:=False
    Application.CutCopyMode = False
    Columns("D:D").ClearContents
End Sub

```