PDA

View Full Version : Copy text in a column till last row based on adjacent column



rohan8510
02-21-2015, 04:53 AM
hi could you please help me out with this code getting error while running




Workbooks.Add
newWB = ActiveWorkbook.Name

Set lastrow = Range(Workbooks(newWB).Sheets("Sheet1").range("g") & Rows.Count).End(xlUp).Row
Range("f2:f" & lastrow) = "CB"

rohan8510
02-21-2015, 04:57 AM
hi could you please help me out with this code getting error while running, many thanks




Set lastrow = Range(Workbooks(newWB).Sheets("Sheet1").range("g") & Rows.Count).End(xlUp).Row
Range("f2:f" & lastrow) = "CB"