Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I am having a problem inserting a Row into a Colum with Names, the Colum also
has empty Cells, I have to find Name and then insert a row over the Name before continuing. I am using the visuel Basic with excel 2007 Thanks |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
See if the following example helps.
Sub Macro1() Dim rngColumn As Range Dim foundCell As Range Dim findWhat As String With Sheets("Sheet1") Set rngColumn = .Columns("C") End With 'InputBox to get the value to find findWhat = InputBox("enter name to find") 'You may need to alter the parameters 'in the Find depending on your needs. 'Example xlPart only has to have the 'required value somewhere in the cell 'whereas xlWhole, the entire cell must 'match the required value exactly. Set foundCell = rngColumn.Find(What:=findWhat, _ LookIn:=xlFormulas, _ LookAt:=xlPart, _ SearchOrder:=xlByRows, _ SearchDirection:=xlNext, _ MatchCase:=False, _ SearchFormat:=False) If Not foundCell Is Nothing Then foundCell.EntireRow.Insert End If End Sub -- Regards, OssieMac "Dunomuch" wrote: I am having a problem inserting a Row into a Colum with Names, the Colum also has empty Cells, I have to find Name and then insert a row over the Name before continuing. I am using the visuel Basic with excel 2007 Thanks |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() "OssieMac" wrote: See if the following example helps. Sub Macro1() Dim rngColumn As Range Dim foundCell As Range Dim findWhat As String With Sheets("Sheet1") Set rngColumn = .Columns("C") End With 'InputBox to get the value to find findWhat = InputBox("enter name to find") 'You may need to alter the parameters 'in the Find depending on your needs. 'Example xlPart only has to have the 'required value somewhere in the cell 'whereas xlWhole, the entire cell must 'match the required value exactly. Set foundCell = rngColumn.Find(What:=findWhat, _ LookIn:=xlFormulas, _ LookAt:=xlPart, _ SearchOrder:=xlByRows, _ SearchDirection:=xlNext, _ MatchCase:=False, _ SearchFormat:=False) If Not foundCell Is Nothing Then foundCell.EntireRow.Insert End If End Sub -- Regards, OssieMac "Dunomuch" wrote: I am having a problem inserting a Row into a Colum with Names, the Colum also has empty Cells, I have to find Name and then insert a row over the Name before continuing. I am using the visuel Basic with excel 2007 Thanks thanks for the answer , im afraid i did not give a precise question, in Column A i have about 380 names with empty cells inbetween from a SAP list, with other data in 2 other Columns, B and C in Column A the only value in all Names is "," and the empty has to be directly over the Name so that i can later build a Table by i think transponding?? |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
formular for finding data and inserting value in seperate column | Excel Discussion (Misc queries) | |||
Keeping a sum colum correct after inserting a colum of data in fro | Excel Discussion (Misc queries) | |||
Finding the minimum in a selected number of rows of the same colum | Excel Worksheet Functions | |||
Finding a Value and inserting a value in another cell | Excel Worksheet Functions | |||
Help finding colum with VBA | Excel Programming |