Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 05-06-2018, 08:18 AM
Logit Logit is offline Need Help With a Macro Windows 10 Need Help With a Macro Office 2007
Expert
 
Join Date: Jan 2017
Posts: 591
Logit is a jewel in the roughLogit is a jewel in the roughLogit is a jewel in the roughLogit is a jewel in the rough
Default

You are welcome.



Hello NoSparks ! How have you been ?
Reply With Quote
  #2  
Old 05-10-2018, 05:01 AM
Shashi Kant Shashi Kant is offline Need Help With a Macro Windows 7 32bit Need Help With a Macro Office 2016
Novice
 
Join Date: May 2018
Posts: 16
Shashi Kant is on a distinguished road
Default Query Ansered

Code:
Private Sub CommandButton1_Click()
    Dim ws As Worksheet
    Dim i As Integer
    For Each ws In Worksheets
        ws.Select
        For i = 1 To ws.Cells(Rows.Count, "Y").End(xlUp).Row
            If ws.Cells(i, "Y").Value = "G" And ws.Cells(i, "Z") > 1 Then
                ws.Range(ws.Cells(i - 1, "Y"), ws.Cells(i - 1, "Z")).Value = _
                ws.Range(ws.Cells(i, "Y"), ws.Cells(i, "Z")).Value
                ws.Cells(i, "Y").Select
                Selection.EntireRow.Delete Shift:=xlUp
            End If
        Next i
    Next ws
End Sub
Attached Files
File Type: xlsm Query.xlsm (28.0 KB, 11 views)

Last edited by Pecoflyer; 05-12-2018 at 12:15 AM. Reason: Added code tags
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
Need Help With a Macro Footnote extraction macro [Why is this macro so slow? / anyway to make it faster?] Le_Blanc Word VBA 10 03-22-2021 11:38 AM
Spell check macro within macro button field doesn't work in one document samuelle Word VBA 0 07-20-2016 02:27 AM
Need Help With a Macro Macro Question: Need help making a macro to highlight the first word in every sentence LadyAna Word 1 12-06-2014 10:39 PM
Macro Needed to bold specific lines and Macro to turn into CSV anewteacher Word VBA 1 05-28-2014 03:59 PM
custom icon, undo/redo for macro, permanent macro Rapier Excel 0 08-05-2013 06:30 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 02:57 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft