Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
On Jul 11, 9:47 am, Nm wrote:
On Jul 10, 6:00 pm, Dan Thompson wrote: "Dan R." wrote: Here's a shorter way that works... Sub Test() For Each cell In ActiveSheet.Range("A1:C1") If cell.Value = "YES" Then Set sh = ThisWorkbook.Worksheets.Add sh.Name = Range("Sheet_Name_" & cell.Column) Range("Data_" & cell.Column).Copy _ Sheets(Range("Sheet_Name_" & _ cell.Column).Text).Range("A1") Sheets(Range("Sheet_Name_" & _ cell.Column).Text).Columns("A").AutoFit End If Next cell End Sub -- Dan Gee Thats funny that it works for NM cause when I run Dan R. Code I get a Run-Time Error "Method 'Range' of 'object '_Global' failed" Whats with ("Sheet_Name_ ect... ") and ("Data_" ...ect) are they user variables or are they actual vba commands ?- Hide quoted text - - Show quoted text - Hi Dan, The ("Sheet_Name_ ect... ") and ("Data_" ...ect) are ranges in my file. Naeem- Hide quoted text - - Show quoted text - Hi Dan, The ("Sheet_Name_ ect... ") and ("Data_" ...ect) are ranges in my file. Naeem |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
http://CannotDeleteFile.net - Cannot Delete File? Try Long Path ToolFilename is too long? Computer Complaining Your Filename Is Too Long? TheLong Path Tool Can Help While most people can go about their businessblissfully unaware of the Windo | Excel Discussion (Misc queries) | |||
Code takes to long | Excel Discussion (Misc queries) | |||
Long Code | Excel Discussion (Misc queries) | |||
my code too long? | Excel Worksheet Functions | |||
Long-winded code | Excel Programming |