Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hello,
Sheet3 has data input Dates - B8:B15, Description - D8:D15, & Type - E8:E16 I need the script to loop through these cells if there is data in them to insert that data in Sheet2 next blank row. The macro below will insert data for B8, D8, & E8 but will not for the other cells that have data. So how can this macro be modified to loop through Sheet3 cells B8:B15, D8:D15, & E8:E16 and insert the data in Sheet2 next blank rows? Sub FindBlankRowInsertData() Dim lastrow As Object Dim currentWorkbook As Workbook Dim WS As Worksheet With currentWorkbook Set lastrow = Sheet2.Range("a65536").End(xlUp) Set WS = Sheet3 'write the data to the new sheets lastrow.Offset(1, 0) = WS.Range("D8:D15").Value lastrow.Offset(1, 1) = WS.Range("B8:B15").Value lastrow.Offset(1, 2) = WS.Range("E8:E15").Value End With End Sub Thank you for your help, jfcby |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
insert rows in locked worksheet - from Excel 2003 to 2000 | Excel Discussion (Misc queries) | |||
Excel 2003-Insert Cut Cells | Setting up and Configuration of Excel | |||
Delete row if all cells are blank, Excel 2000 & 2003 | Excel Discussion (Misc queries) | |||
unlocked cells in excel 2000 now locked when opened in 2003 why? | Excel Discussion (Misc queries) | |||
In Excel 2000, Cannot edit cells in worksheet created in 2003? | Excel Discussion (Misc queries) |