Re: Clear cells running a macro, and Undo
Try this out
Re: Clear cells running a macro, and Undo
Try this out
Re: Error 424 Object required
It depends on what your doing. In your case no.
Re: Error 424 Object required
Ah I see, "my mistake"
Remove the Select line I added.
Once its pasted its already selected. Thats why it errored out.
Re: Email copy of Active Workbook without closing the workbook
Dim Answer As String
Dim MyNote As String
'Place your text here
MyNote = "Shall I Save Your Work Now?"
'Display MessageBox
Answer = MsgBox(MyNote, vbQuestion + vbYesNo, "Save Changes")
If Answer = vbNo Then
'Code for No button Press
MsgBox "No Problem. We'll Just Send The Workbook As Is."
Else
'Code for Yes button Press
ActiveWorkbook.Save
End If
MsgBox "There Will Be A Brief Pause While I Attach Your Workbook. A Temp File Is Being Placed On Your Desktop."
ChDir "C:\Users\YOURNAME\Desktop" '<<< Change as needed
ActiveWorkbook.SaveAs Filename:="C:\Users\ValdostaMill\Desktop\ToBeEmailed.xlsm", _
FileFormat:=xlOpenXMLWorkbookMacroEnabled, CreateBackup:=False
ActiveWorkbook.SendMail Recipients:="", _
Subject:=" Here Is Your Workbook "
Display More
Give this a try
Re: Error 424 Object required
Sub Macro99()
'Step 1: Declare your variables
Dim PP As PowerPoint.Application
Dim PPPres As PowerPoint.Presentation
Dim PPSlide As PowerPoint.Slide
Dim SlideTitle As String
'Step 2: Open PowerPoint and create new presentation
Set PP = New PowerPoint.Application
Set PPPres = PP.Presentations.Add
PP.Visible = True
'Step 3: Add new slide as slide 1 and set focus to it
Set PPSlide = PPPres.Slides.Add(1, ppLayoutTitleOnly)
PPSlide.Select
'Step 4: Copy the range as a picture
Sheets("Slide Data").Range("A1:J28").CopyPicture _
Appearance:=xlScreen, Format:=xlPicture
'Step 5: Paste the picture and adjust its position
PPSlide.Shapes.Paste
PPSlide.Shapes.Select 'After Pasting Select the Shape. This is a separate line of code.
PP.ActiveWindow.Selection.ShapeRange.Align msoAlignCenters, True 'Because this line deals with "Selection" is why
PP.ActiveWindow.Selection.ShapeRange.Align msoAlignMiddles, True
'Step 6: Add the title to the slide
SlideTitle = "My First PowerPoint Slide"
PPSlide.Shapes.Title.TextFrame.TextRange.Text = SlideTitle
'Step 7: Memory Cleanup
PP.Activate
Set PPSlide = Nothing
Set PPPres = Nothing
Set PP = Nothing
End Sub
Display More
Re: If Found then Display error
forum.ozgrid.com/index.php?attachment/54036/
See if this does what you want. I created a column to combine the 2 columns together. Then used a search to detect a duplicate.
Type a number in txtRoll and txtTicket textboxes and click "Check Ticket #"
Cheers
Re: Right Function In VBA To Count the Zero's
Thanks for taking the time to work out another solution Mr Bill
Re: Right Function In VBA To Count the Zero's
I am a little embarrassed I must say lol. That seems to have done the trick jindon. Thanks so much
Good day my friends,
I have a rather interesting problem I have not been able to sort. I have a line of code that extracts the last two digits of a certain cell and places them in the cell next to it. However, if the last two digits are Zeros it only returns the first whole number in the cell.
This is what I have...
If my cells value is 6.00 it returns 0.60 now matter how I change the format or the VBA code.
Note...
In order for everything else to work... the "0." in my code must remain as it is part of a Vlookup.
Thanks for any advice.
Cheers
Re: Excel macro to enable/disable worksheet event macros in all worksheets in a workb
Place your Macro in "ThisWorkbook" Open Event. Its located under the Sheets in the VBA Editor. The code will only run when the book opens.
Re: un-hiding sheets message box
Anytime
Re: auto filter automatically based on two cell values
Try this
Private Sub Worksheet_Change(ByVal Target As Range)
Const WS_RANGE As String = "N1" '<== change to suit
Const WS_RANGE2 As String = "O1" '<== change to suit
On Error GoTo ws_exit
Application.EnableEvents = False
If Not Intersect(Target, Me.Range(WS_RANGE)) Is Nothing Then
Me.Range("A1:D1").AutoFilter field:=3, Criteria1:="*" & Target.Value & "*"
End If
If Not Intersect(Target, Me.Range(WS_RANGE2)) Is Nothing Then
Me.Range("A1:D1").AutoFilter field:=4, Criteria1:="*" & Target.Value & "*"
End If
ws_exit:
Application.EnableEvents = True
End Sub
Display More
Re: auto filter automatically based on two cell values
Private Sub Worksheet_Change(ByVal Target As Range)
Const WS_RANGE As String = "N1" '<== change to suit
Const WS_RANGE2 As String = "O1" '<== change to suit
On Error GoTo ws_exit
Application.EnableEvents = False
If Not Intersect(Target, Me.Range(WS_RANGE)) Is Nothing Then
Me.Range("A1:D1").AutoFilter field:=3, Criteria1:=Target.Value
End If
If Not Intersect(Target, Me.Range(WS_RANGE2)) Is Nothing Then
Me.Range("A1:D1").AutoFilter field:=4, Criteria1:=Target.Value
End If
ws_exit:
Application.EnableEvents = True
End Sub
Display More
Re: VBA "sumifs" code allows "IF" function for sub-criteria
Can you explain what the Function is supposed to do? I'm a little confused
Re: Display specific values and columns macro code
Like this?
forum.ozgrid.com/index.php?attachment/51063/
Hope this helps. Cheers
Re: Move to cell in predefined area based on random number.
Thanks for the reply. I appreciate your efforts. Is it possible to predefine a named range for this and make it loop. Lets say the named range is Circle. It consists of a grid 2 x 2 cells. A1 B1 A2 B2. A1 is the start if a 1 is rolled it moves to B2. If next a 2 is rolled it moves to A2. It moved down and back over. Then lets say a 3 is rolled, it would then end up at B2. Making a complete circle and staying inside the named range.
I hope that helps clear it it a bit.
Thanks in advance for any insight to this problem.
What I would like to do is move from the Activecell to a cell defined by a random number. Picture a Square board game. 10 cells wide 10 cells deep. What should happen is as follows.
Lets say you start in A1 and the random number is 5. The new Active cell should now be E1. But if you start in A1 and an 11 is pulled then you should end up in J2. Then eventually working around in a complete circle back to A1 and so on.
See photo for an example. Only the red cells should be able to be selected. Although the red is just to show what i mean and will not be in the game. [ATTACH=CONFIG]49807[/ATTACH]
Thanks again.
Re: Finding the smallest difference for three variables
What about =MIN(A1:D1)