# Search:

Type: Posts; User: Michael M; Keyword(s):

Page 1 of 6 1

1. ## Thread: Convert excel formula to vba

by Michael M
Replies
1
Views
49

### Re: Convert excel formula to vba

Try

With Range("AC2:AC" & lr)
.Formula = "=A2 & "" - "" & D2"
.Value = .Value
End With
2. ## Thread: Hide and Show worksheets

by Michael M
Replies
2
Views
51

### Re: Hide and Show worksheets

Greg
Have at a look at this thread.
If you need further help, post back

https://www.mrexcel.com/forum/excel-questions/973802-vba-unhide-sheet-then-re-hide.html
3. ## Thread: If cell is Empty!

by Michael M
Replies
5
Views
102

### Re: If cell is Empty!

OOps sorry....

Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)
Dim ws As Worksheet
For Each ws In Worksheets
With ws
If .Cells(10, 5).Value = "" Then
...
4. ## Thread: If cell is Empty!

by Michael M
Replies
5
Views
102

### Re: If cell is Empty!

Try

Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)
Dim ws As Worksheet
For Each ws In Worksheets
With ws
If .Cells(10, 5).Value = "" Then
...
5. ## Thread: VBA: need unique values from a column

by Michael M
Replies
7
Views
188

### Re: VBA: need unique values from a column

Try

Sub MM1()
Range("G2:G" & Cells(Rows.Count, "G").End(xlUp).Row).AdvancedFilter Action:=xlFilterCopy, CopyToRange:=ActiveSheet.Range("H2"), Unique:=True
End Sub
6. ## Thread: why giving me N/A?

by Michael M
Replies
11
Views
260

### Re: why giving me N/A?

N/a is not a zereo !!
If N/a is a possiibility, try

=IF(OR(G8=0,G8="N/a",AB8>=0),0,AB8)
7. ## Thread: Need a VBA Code for select multiple sheets on excel

by Michael M
Replies
6
Views
174

### Re: Need a VBA Code for select multiple sheets on excel

Ok, glad you got it sorted ...:beerchug:
8. ## Thread: Run-time error '1004'

by Michael M
Replies
6
Views
153

### Re: Run-time error '1004'

Does the one further down work ???

For Each con In wkm.Connections

If con.Name = "Query - MONTHLY REPORTING" Then con.Refresh

Next

by Michael M
Replies
4
Views
125

### Re: Formulas

Try

=IF(ISNUMBER(A1),1,0)
10. ## Thread: Don't understand this range reference

by Michael M
Replies
4
Views
147

### Re: Don't understand this range reference

the 1 at the beginning of this section of the formula "forces" the results from, for example, {TRUE,FALSE,TRUE}

1/(\$d\$1:\$d3<>"")

to then having 1 be divided by them, thus forcing them to be...
11. ## Thread: Need a VBA Code for select multiple sheets on excel

by Michael M
Replies
6
Views
174

### Re: Need a VBA Code for select multiple sheets on excel

This will select by Sheet name

Sub MM1()
Sheets("Sheet X").Select
Sheets("Sheet Z").Select (False)
End Sub

And this one by Sheet number
12. ## Thread: Run-time error '1004'

by Michael M
Replies
6
Views
153

### Re: Run-time error '1004'

Is the drive correct AND path EXACTLY the same...still 'C:\Users\John\Desktop\Monthly Reporting'.
you might have to post the entire code !!
13. ## Thread: Display message based on cell value

by Michael M
Replies
9
Views
138

### Re: Display message based on cell value

Maybe this UNTESTED

Private Sub Worksheet_Change(ByVal Target As Range)
Dim A As Range, r As Range
Set A = Range("B3:B16")
If Intersect(Target, A) Is Nothing Then Exit Sub
For Each r In A...
14. ## Thread: Run-time error '1004'

by Michael M
Replies
6
Views
153

### Re: Run-time error '1004'

Sounds more like the file / folder has either been moved, or has been renamed !
15. ## Thread: Import Sheet error

by Michael M
Replies
6
Views
327

### Re: Import Sheet error

When checking the sheet names did you make sure there were no leading / trailling spaces in the sheet name ??
16. ## Thread: Basic Formula to Button

by Michael M
Replies
2
Views
44

### Re: Basic Formula to Button

Do you mean....assuming Range("A1") to be where the formula needs to be placed !

Range("A1").formula="=INDEX(\$F\$6:\$F\$13,MATCH(REPT(""z"",255),\$F\$6:\$F\$13))"
17. ## Thread: Import Sheet error

by Michael M
Replies
6
Views
327

### Re: Import Sheet error

Works fine for me...
Make sure the sheet names are correct AND neither workbook is protected !!

Sub Copy_Frontlog()
Dim sourceworkbook As Workbook, currentworkbook As Workbook
Set...
18. ## Thread: VBA range not recognized

by Michael M
Replies
8
Views
151

### Re: VBA range not recognized

Ok, gotcha......works fine for me, in terms of resorting to Proper case !!
Close and reopen maybe...never actually noticed it before on any of my projects.
19. ## Thread: VBA range not recognized

by Michael M
Replies
8
Views
151

### Re: VBA range not recognized

That won't work anyway....what are you trying to do ??
20. ## Thread: 2013 workbooks don't work in 2016, WHY?

by Michael M
Replies
4
Views
129

### Re: 2013 workbooks don't work in 2016, WHY?

What I meant was did you open the file in 2016, then save it !!
CXan you Upload your file to a sharing site, Dropbox for instance, and then post the link back here ??
21. ## Thread: 2013 workbooks don't work in 2016, WHY?

by Michael M
Replies
4
Views
129

### Re: 2013 workbooks don't work in 2016, WHY?

Have you tried saving the 2013 workbook as a 2016 xlsm workbook ??
What code are you using in the 2013 ?
22. ## Thread: Applying two conditions in formula

by Michael M
Replies
5
Views
226

### Re: Applying two conditions in formula

Maybe this....UNTESTED

=IF(AND(E4="FT",U4>=DATE(2019,2,1),U4<=DATE(2010,10,10)),VLOOKUP(A4,'Test Source'!\$B\$2:\$Y\$200,23,0),0)
23. ## Thread: delete rows based on value in a column cell that is > or equal to 0

by Michael M
Replies
4
Views
111

### Re: delete rows based on value in a column cell that is > or equal to 0

Change this line

For r = lr To 2 Step -1

To

For r = lr To 6 Step -1
24. ## Thread: delete rows based on value in a column cell that is > or equal to 0

by Michael M
Replies
4
Views
111

### Re: delete rows based on value in a column cell that is > or equal to 0

MAybe this

Sub MM1()
Dim lr As Long, r As Long
lr = Cells.Find("*", , xlValues, , xlRows, xlPrevious).Row
For r = lr To 2 Step -1
If Cells(r, "J") >= 0 Then Rows(r).Delete
Next r
End Sub
25. ## Thread: Form from Options--> All commands vs VBA form

by Michael M
Replies
1
Views
68

### Re: Form from Options--> All commands vs VBA form

The "automatic" is quicker / simpler to create, but the order of input is fixed. So it basically is in the column order of input
Whereas a form created by you can input the data in any order....and...
Results 1 to 25 of 150
Page 1 of 6 1