Try this
Sub fmt()
Const ColList As String = "Field1,Field2,Field3,Field4"
Dim Heading As Variant, ColArray As Variant
Dim headingFound As Range
ColArray = Split(ColList, ",")
For Each Heading In ColArray
On Error Resume Next
Set headingFound =...
I guess there's some confusion about 2 dimensions. When an array is assigned by passing values from a range (whether M x 1 or 1 x N), it will always be two dimensional, which means that the array will have column(s) and row(s). That doesn't mean there will be more than 1 column if it is a single...
While you revert to Narayan's question, can you also say why the number of days for the second and third activities are 91 and 29 respectively, when the days are actually 92 and 29? Are you considering some kind of holiday in between? If yes, that's probably why the number of days for the first...
Hi Narayan,
Just curious why you say that there will always be 1 column 'more' than that in the range? If the passed range has only 1 column, I think I've seen the array also having just one column. I probably am missing something, so could you let me know.
Just to query. I see a line which says that the solution should be using SUMIF function. I don't see any solution using SUMIF above. So am I misunderstanding something?
You've mentioned 2 columns in your dimensioned string array. Not sure why you need to, if you only need to pass one column.
Anyway, here's an example of how you can pass values from a range to an array
Sub SMC()
Dim varSourceValues as Variant
varSourceValues = Range("B1:B1000").Value...
I would have thought it's straight forward. In a normal sense, you just need to copy the entire range of cells and paste it elsewhere. This will not copy the hidden cells. Since you are mentioning something about 'cleaning up' the cells, maybe you want to attach a sample file and explain your...
Brian, got a bit delayed. Just wanted to check, what about the name of the months in the folder? Will there be multiple months? How would the code determine whether you're looking at Aug or Sep, or any other month for that matter?
Also, can we assume that if the type 1 file is present, then it...
OK, and do you have a list of the Clients somewhere? Or does this have to be picked from the folder dynamically?
By the way, pretty late here. If you don't get help by tomorrow, I'll get back to you.
Try this
Sub SMC1()
Dim rng As Range
For Each rng In Range("g1:g100") 'Adjust as necessary
If UCASE(rng.Value) = "DR" Then
Cells(rng.Row, "H").Value = Cells(rngRow,"B").Value
ElseIf UCASE(rng.Value) = "CR" Then
Cells(rng.Row, "H").Value =...
Just writing this on the run here. This is just one way of doing it.
Sub SMC()
Dim rng As Range
For Each rng In ActiveSheet.UsedRange.Cells
If rng.Locked = False And InStr(1, UCase(rng.Formula), "SUM(") > 0 Then
rng.Interior.Color = vbRed
End If
Next...
Not sure about most efficient way, but a few good ways (though easily bypassed by many) to secure a workbook would be Open-Write protection, Sheet Protection and Workbook Protection.
Check post #4 by Juan. This seems to be exactly what you are looking for
http://www.mrexcel.com/forum/excel-questions/47074-get-worksheet-names-closed-workbook.html
This seems like what you are looking to do
http://www.excelfox.com/forum/f2/mailing-a-range-or-selection-in-the-body-of-an-e-mail-message-help-323/
http://www.excelfox.com/forum/f18/send-outlook-mail-with-signature-range-from-excel-and-multiple-email-ids-304/