|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
If column B cell is a certain value then copy and paste the value to column A
So Far I have this its not working too well haha
Code:
Sub MI_TEST_1() ' MI_TEST_1 Macro Dim nxtRow As Integer Dim i As Integer For i = 1 To Cells(Rows.Count, 2).End(xlUp).Row 'If Left(Cells(i, 2), 1) = "T" Then 'Determine if change was to Column F (6) If Target.Column = 2 Then 'If Yes, Determine if cell = B If Target.Value = Left(Cells(i, 2), 1) = "T" Then nxtRow = Sheets(2).Range("B" & Rows.Count).End(xlUp).Row + 1 Target.EntireRow.Copy _ Destination:=Sheets(2).Range("A" & nxtRow) End If End If End Sub For Example: IF cell B10 is "T1" then paste a "T" in to cell A10 if A10 is empty Cross post: http://www.mrexcel.com/forum/excel-q...ml#post4342659 http://www.excelforum.com/excel-prog...ml#post4241066 |
#2
|
|||
|
|||
I struggle to understand why you are trying to do something in VBA that is blindingly easy in Excel - see attached
The automatic detecetion of whether a cell has changed, and if so whether it matters are the essence of Excel - why try and re-write it? If you do not know Excel, then it is a thousand times easier to learn than VBA |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Copy column 1 data into Column 3 | ShailShin | Word VBA | 1 | 06-18-2015 10:49 AM |
Excel copy two numbers between specific column and paste in next sheet | visha_1984 | Excel | 1 | 12-26-2014 07:59 PM |
how can i split a column of rows in half without copy and paste.. | Lindseyfparker | Excel | 2 | 04-25-2014 12:52 AM |
keep each item/cell in column A associated with a group in column C | ht889 | Excel | 1 | 02-25-2014 12:36 PM |
How can I delete the content of a cell in column if the cell value is more than 1000? | Learner7 | Excel | 2 | 06-27-2011 05:44 AM |