Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I am attempting to create a macro that will allow me to survey a column
of data and fill any empty cells with the input from the corresponding row of data from another column. As an example: Store Name Distributor Name Jiffy JIF Skippy SKIP Kraft Butterball BUTTER I would want my macro to insert the text "Kraft" into the third row of data in the distributor column. I have toyed with the following macro, to little success: Dim i As Integer Sheets("Data Mapping").Select For i = 1 To 104 If Range("C & i + 7").Text = 0 Then Range("A & i + 7").Select Selection.Copy Range("C & i +7").Select ActiveSheet.Paste Next i (I have 104 rows of data that I want to "fill", starting in row 8). Any input that you might have would be most appreciated. Thanks |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi Paul
Use this example (almost the same) http://www.contextures.com/xlDataEntry02.html -- Regards Ron de Bruin http://www.rondebruin.nl wrote in message ups.com... I am attempting to create a macro that will allow me to survey a column of data and fill any empty cells with the input from the corresponding row of data from another column. As an example: Store Name Distributor Name Jiffy JIF Skippy SKIP Kraft Butterball BUTTER I would want my macro to insert the text "Kraft" into the third row of data in the distributor column. I have toyed with the following macro, to little success: Dim i As Integer Sheets("Data Mapping").Select For i = 1 To 104 If Range("C & i + 7").Text = 0 Then Range("A & i + 7").Select Selection.Copy Range("C & i +7").Select ActiveSheet.Paste Next i (I have 104 rows of data that I want to "fill", starting in row 8). Any input that you might have would be most appreciated. Thanks |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Sub a()
Dim Cell As Range On Error GoTo EndThis ''in case no blanks For Each Cell In Worksheets("Data Mapping") _ .Range("C8:C111").SpecialCells(xlCellTypeBlanks) Cell.Value = Cell.Offset(0, -1).Value Next EndThis: End Sub -- Jim "Ron de Bruin" wrote in message ... | Hi Paul | | Use this example (almost the same) | http://www.contextures.com/xlDataEntry02.html | | -- | Regards Ron de Bruin | http://www.rondebruin.nl | | | wrote in message ups.com... | I am attempting to create a macro that will allow me to survey a column | | of data and fill any empty cells with the input from the corresponding | row of data from another column. As an example: | | | Store Name Distributor Name | | | Jiffy JIF | Skippy SKIP | Kraft | Butterball BUTTER | | | I would want my macro to insert the text "Kraft" into the third row of | data in the distributor column. I have toyed with the following macro, | | to little success: | | | Dim i As Integer | Sheets("Data Mapping").Select | For i = 1 To 104 | If Range("C & i + 7").Text = 0 Then | Range("A & i + 7").Select | Selection.Copy | Range("C & i +7").Select | ActiveSheet.Paste | Next i | | | (I have 104 rows of data that I want to "fill", starting in row 8). | Any input that you might have would be most appreciated. Thanks | | | |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I am attempting to create a macro
Oops, thanks Jim -- Regards Ron de Bruin http://www.rondebruin.nl "Jim Rech" wrote in message ... Sub a() Dim Cell As Range On Error GoTo EndThis ''in case no blanks For Each Cell In Worksheets("Data Mapping") _ .Range("C8:C111").SpecialCells(xlCellTypeBlanks) Cell.Value = Cell.Offset(0, -1).Value Next EndThis: End Sub -- Jim "Ron de Bruin" wrote in message ... | Hi Paul | | Use this example (almost the same) | http://www.contextures.com/xlDataEntry02.html | | -- | Regards Ron de Bruin | http://www.rondebruin.nl | | | wrote in message ups.com... | I am attempting to create a macro that will allow me to survey a column | | of data and fill any empty cells with the input from the corresponding | row of data from another column. As an example: | | | Store Name Distributor Name | | | Jiffy JIF | Skippy SKIP | Kraft | Butterball BUTTER | | | I would want my macro to insert the text "Kraft" into the third row of | data in the distributor column. I have toyed with the following macro, | | to little success: | | | Dim i As Integer | Sheets("Data Mapping").Select | For i = 1 To 104 | If Range("C & i + 7").Text = 0 Then | Range("A & i + 7").Select | Selection.Copy | Range("C & i +7").Select | ActiveSheet.Paste | Next i | | | (I have 104 rows of data that I want to "fill", starting in row 8). | Any input that you might have would be most appreciated. Thanks | | | |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Ron, I didn't mean to post this to you, sorry. Obviously I saw your post
but after having worked a hard 3 minutes on this I didn't want to throw it away.<g -- Jim "Ron de Bruin" wrote in message ... | I am attempting to create a macro | Oops, thanks Jim | | -- | Regards Ron de Bruin | http://www.rondebruin.nl | | | "Jim Rech" wrote in message ... | Sub a() | Dim Cell As Range | On Error GoTo EndThis ''in case no blanks | For Each Cell In Worksheets("Data Mapping") _ | .Range("C8:C111").SpecialCells(xlCellTypeBlanks) | Cell.Value = Cell.Offset(0, -1).Value | Next | EndThis: | End Sub | | | -- | Jim | "Ron de Bruin" wrote in message | ... | | Hi Paul | | | | Use this example (almost the same) | | http://www.contextures.com/xlDataEntry02.html | | | | -- | | Regards Ron de Bruin | | http://www.rondebruin.nl | | | | | | wrote in message | ups.com... | | I am attempting to create a macro that will allow me to survey a column | | | | of data and fill any empty cells with the input from the corresponding | | row of data from another column. As an example: | | | | | | Store Name Distributor Name | | | | | | Jiffy JIF | | Skippy SKIP | | Kraft | | Butterball BUTTER | | | | | | I would want my macro to insert the text "Kraft" into the third row of | | data in the distributor column. I have toyed with the following macro, | | | | to little success: | | | | | | Dim i As Integer | | Sheets("Data Mapping").Select | | For i = 1 To 104 | | If Range("C & i + 7").Text = 0 Then | | Range("A & i + 7").Select | | Selection.Copy | | Range("C & i +7").Select | | ActiveSheet.Paste | | Next i | | | | | | (I have 104 rows of data that I want to "fill", starting in row 8). | | Any input that you might have would be most appreciated. Thanks | | | | | | | | | | |
#6
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi Jim
hard 3 minutes 3 seconds for you <g -- Regards Ron de Bruin http://www.rondebruin.nl "Jim Rech" wrote in message ... Ron, I didn't mean to post this to you, sorry. Obviously I saw your post but after having worked a hard 3 minutes on this I didn't want to throw it away.<g -- Jim "Ron de Bruin" wrote in message ... | I am attempting to create a macro | Oops, thanks Jim | | -- | Regards Ron de Bruin | http://www.rondebruin.nl | | | "Jim Rech" wrote in message ... | Sub a() | Dim Cell As Range | On Error GoTo EndThis ''in case no blanks | For Each Cell In Worksheets("Data Mapping") _ | .Range("C8:C111").SpecialCells(xlCellTypeBlanks) | Cell.Value = Cell.Offset(0, -1).Value | Next | EndThis: | End Sub | | | -- | Jim | "Ron de Bruin" wrote in message | ... | | Hi Paul | | | | Use this example (almost the same) | | http://www.contextures.com/xlDataEntry02.html | | | | -- | | Regards Ron de Bruin | | http://www.rondebruin.nl | | | | | | wrote in message | ups.com... | | I am attempting to create a macro that will allow me to survey a column | | | | of data and fill any empty cells with the input from the corresponding | | row of data from another column. As an example: | | | | | | Store Name Distributor Name | | | | | | Jiffy JIF | | Skippy SKIP | | Kraft | | Butterball BUTTER | | | | | | I would want my macro to insert the text "Kraft" into the third row of | | data in the distributor column. I have toyed with the following macro, | | | | to little success: | | | | | | Dim i As Integer | | Sheets("Data Mapping").Select | | For i = 1 To 104 | | If Range("C & i + 7").Text = 0 Then | | Range("A & i + 7").Select | | Selection.Copy | | Range("C & i +7").Select | | ActiveSheet.Paste | | Next i | | | | | | (I have 104 rows of data that I want to "fill", starting in row 8). | | Any input that you might have would be most appreciated. Thanks | | | | | | | | | | |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
filling in empty cells - | Excel Discussion (Misc queries) | |||
Help on filling empty cells with string + row() | Excel Discussion (Misc queries) | |||
Filling empty cells with a value | Excel Discussion (Misc queries) | |||
Filling in empty cells in columns | Excel Discussion (Misc queries) | |||
Filling the first empty cell | Excel Programming |