![]() |
#7
|
|||
|
|||
![]() Quote:
Thanks for your reply. Don't really get what you mean. But now I'm trying to remove all blank fields from the source data (excel) instead. However, instead of removing blank fields from just 1 sheet, I would like to loop through the entire worksheet and remove every blank field from every sheet. My excel vba code is as follows. However, this code only allows blank fields from the 'active sheet' to be removed whereas the blank fields from other sheets will not be removed. Able to advise? Sub WorksheetLoop() ' Declare Current as a worksheet object variable. Dim Current As Worksheet ' Loop through all of the worksheets in the active workbook. For Each Current In Worksheets ' Insert your code here. On Error Resume Next Range("A2:A" & Current.UsedRange.Rows.Count).SpecialCells(xlCellT ypeBlanks).EntireRow.Delete ' This line displays the worksheet name in a message box. MsgBox Current.Name Next End Sub |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
![]() |
ahw | Word VBA | 43 | 02-28-2020 08:11 PM |
![]() |
aussiew | Word VBA | 5 | 03-10-2019 02:55 PM |
![]() |
nolanthomas32 | Word VBA | 4 | 09-19-2017 06:25 AM |
![]() |
snips1982 | Word | 2 | 03-22-2017 03:37 AM |
Word 2010 Content Control help - Combo Boxes vs Drop Down List | proghy | Word | 1 | 09-16-2014 02:01 PM |