Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 83
Default find row value, insert column

Hi everybody!
I'm trying to create a loop for a range of rows, find certain value, insert
a column if there is a match and copy cells to that new column, if not a
match go to next

So far I have

Sub InsertColumns ()

Sheets("data").Range("G15").Select
'I need to check row 15 to end

Do
If ActiveCell.Offset(0, 0).Value = "QC Std 2" Then
ActiveCell.Offset(0, 0).Select
Selection.EntireColumn.Offset(0, 1).Insert
'Range("H78", "H88").Copy Destination:=ActiveCell.Offset(-7, 0)

ElseIf ActiveCell.Offset(0, 0).Value = "QC Std 3" Then
ActiveCell.Offset(0, 0).Select
Selection.EntireColumn.Offset(0, 1).Insert

Else
'do nothing, go to next

End If

ActiveCell.Offset(0, 1).Select
Loop Until IsEmpty(ActiveCell.Offset(0, 0))
End Sub

Any help will be more than appreciated!
--
gaba :)
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
Insert Column after specific text title the new column and add for David Excel Discussion (Misc queries) 5 October 2nd 09 04:03 PM
Find something in column a then find if column B matches criteria Darrell_Sarrasin via OfficeKB.com Excel Discussion (Misc queries) 8 November 28th 07 09:40 PM
insert a blank column between each column in a data file Holly Excel Discussion (Misc queries) 1 October 31st 07 07:04 PM
insert row / insert column command buttons fairgreen Excel Worksheet Functions 1 October 29th 07 02:41 PM
Find First Non blank cell than find column header and return that value Silver Rose Excel Worksheet Functions 10 April 30th 07 05:56 PM


All times are GMT +1. The time now is 12:36 PM.

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"