I hope this helps . Sheets can be deleted at once using array of sheet names. In the For-Each loop collect the names of sheets you wish to delete into an array. Then just call Worksheets(sheetsToDeteleArrayHere).delete so all the sheets in the array will be deleted at once. HTH Note: with Trim(sheet-name) it is ensured that the leading and/or ending spaces are not part of the comparison.)
Application.DisplayAlerts = False
For Each sheet In Application.Worksheets
If Trim(sheet.name) = "Close Price" Then GoTo continue
If Trim(sheet.name) = "Parameters" Then GoTo continue
If Trim(sheet.name) = "Stock" Then GoTo continue
If IsArray(sheetsToDetele) Then
ReDim Preserve sheetsToDetele(1 To UBound(sheetsToDetele) + 1)
ReDim sheetsToDetele(1 To 1)
sheetsToDetele(UBound(sheetsToDetele)) = sheet.name
If Not IsArray(sheetsToDetele) Then _
Application.DisplayAlerts = True
hop of those help? I think you are looking for an ADODB.Command. Try something like this:
Dim cnn As New ADODB.Connection
Dim cmd As ADODB.Command
Set cmd = New ADODB.Command
.ActiveConnection = cnn
.CommandText = "EXEC spNameHere param1"
.CommandType = adCmdText
In Excel, can you create a conditional statement that applies to every row in an excel sheet?
wish of those help You have 3 options and it depends: if it's a single value, go with Gary's suggestion and make a Name for it (or if you don't like names put it in a cell and reference that). if your IF statement is used in a column of data you can insert an additional column, do the calculation there (, possibly hide it) and reference that. if you are using VBA and the formula is only used to calculate the values once and then paste as values then consider putting the calculation in VBA.
I hope this helps you . There are couple of issues in code: Dim myrange As String should be Dim myrange As Range myrange = ws_zfi.Range("BM3:BM100000") should be Set myrange = ws_zfi.Range("BM3:BM100000")