Syntax-paste into excel cell

Plz tell the syntax in VB to paste some copied text inside an excel cell.A1. For example paste.cell A1. Also i wana put a condition(Check) if the pasted value in A1 cell is B. Can anyone plz guide.

Copy and paste into Cell

Plz give syntax in VB to paste copied text found in Column A,Row 1 to Column B,Rows 1-5. The raw data is shown as Column A, I want to find "$" in ColumnA and PASTE in Column B, for each line item until the next Blank is found. See example below:

Column A Column B
1$SYSTEM $SYSTEM
2 CONFTEXT $SYSTEM
3 CONFTXT1 $SYSTEM
4 CONFTXT2 $SYSTEM
5 CONFTXT3 $SYSTEM
6
7$SYSTEM2 $SYSTEM2
8 MYTEXT $SYSTEM2
9
10
11$SYSTEM3 $SYSTEM3
12 YOURTXT $SYSTEM3
13 YOURTXT2 $SYSTEM3
14
15

How can this best be done? Is it better to use VB or will a formula like VLOOKUP work? There are a total of 2703 occurances of $ in Column A and there is a total of 60960 lines in column A.

paste.cell A1. Also i wana put a condition(Check) if the pasted value in A1 cell is B. Can anyone plz guide.

Nick's picture

insert a row in row 2, then

insert a row in row 2, then put this formula in B3 and copy it all the way down:
=IF(A2="",A3,B2)

Nick's picture

paste values

you can do:

Range("A1").value = Range("A2").value

this is like copying A2 to A1.

 

then:

if  Range("A1").value = "B" then

' do something

else

' do nothing

endif

 

Recording a macro can help in this case too..

revert paste values

srry nick , perhaps i cudnt ask the right way.
I don want to copy this text from an excel cell to another cell, but i wish to paste this from somewhere else to the excel cell.The text is already copied into the clipboard, i jst want a vb syntax to paste it inside the excell cell.

Plz help.

thanks

Nick's picture

paste values

ok, try this:

 

Range("A1").Select

    ActiveSheet.Paste
 

Thank you. Tx a Ton!!! It

Thank you.
Tx a Ton!!!
It helped me a lot!!!

Tnx Nick,it worked.

Thank-U