VBA Code Editing Help

Vishaal

Well-known Member
Joined
Mar 16, 2019
Messages
533
Office Version
  1. 2010
  2. 2007
Platform
  1. Windows
  2. Web
Thanks in advance,

i have the following VBA code,

Its o.k. no change required

Code:
Range("IX10").Select
    ActiveCell.FormulaR1C1 = _
        "=IF(AND(RC[-253]=""Na"",R[1]C[-253]=""Yes""),COUNTIF(R2C[-253]:RC[-253],""Na"")-SUM(R1C:R[-1]C),"""")"
    Range("IX10").Select
    Selection.Copy
    Range("IX11:IX1798").Select
    ActiveSheet.Paste
    Application.CutCopyMode = False

Second started, its in part
I want to run this code from “IY10” to “SO10”, but if I will run this code at once, Excel will be start the error “Not responding” due to heavy work of code, so please provide the process how can we use the code without making excel “not responding”

Code:
Range("IX10:IX1798").Select
    Selection.Copy
    Range("IY10:JW10").Select
    ActiveSheet.Paste
    Application.CutCopyMode = False
    Range("IY10:JW1798").Select
    Selection.Copy
    Range("IY10").Select
    Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
        :=False, Transpose:=False
    Range("IX8").Select
 
    Range("IX10:IX1798").Select
    Selection.Copy
    Range("JX10:KV10").Select
    ActiveSheet.Paste
    Application.CutCopyMode = False
    Range("JX10:KV1798").Select
    Selection.Copy
    Range("JX10").Select
    Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
        :=False, Transpose:=False
    Range("IX8").Select
    Range("IX10:IX1798").Select
    Selection.Copy
    Range("KW10:LU10").Select
    ActiveSheet.Paste
    Application.CutCopyMode = False
    Range("KW10:LU1798").Select
    Selection.Copy
    Range("KW10").Select
    Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
        :=False, Transpose:=False
    Range("IX8").Select
    Range("IX10:IX1798").Select
    Selection.Copy
    Range("LV10:MT10").Select
    ActiveSheet.Paste
    Application.CutCopyMode = False
    Range("LV10:MT1798").Select
    Selection.Copy
    Range("LV10").Select
    Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
        :=False, Transpose:=False
    Range("IX8").Select
    Range("IX10:IX1798").Select
    Selection.Copy
    Range("MU10:NS10").Select
    ActiveSheet.Paste
    Application.CutCopyMode = False
    Range("MU10:NS1798").Select
    Selection.Copy
    Range("MU10").Select
    Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
        :=False, Transpose:=False
    Range("IX8").Select
    Range("IX10:IX1798").Select
    Selection.Copy
    Range("NT10:OR10").Select
    ActiveSheet.Paste
    Application.CutCopyMode = False
    Range("NT10:OR1798").Select
    Selection.Copy
    Range("NT10").Select
    Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
        :=False, Transpose:=False
    Range("IX8").Select
 
    Range("IX10:IX1798").Select
    Selection.Copy
    Range("OS10:PQ10").Select
    ActiveSheet.Paste
    Application.CutCopyMode = False
    Range("OS10:PQ1798").Select
    Selection.Copy
    Range("OS10").Select
    Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
        :=False, Transpose:=False
    Range("IX8").Select
    Range("IX10:IX1798").Select
    Selection.Copy
    Range("PR10:QP10").Select
    ActiveSheet.Paste
    Application.CutCopyMode = False
    Range("PR10:QP1798").Select
    Selection.Copy
    Range("PR10").Select
    Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
        :=False, Transpose:=False
    Range("IX8").Select
    Range("IX10:IX1798").Select
    Selection.Copy
    Range("QQ10:RO10").Select
    ActiveSheet.Paste
    Application.CutCopyMode = False
    Range("QQ10:RO1798").Select
    Selection.Copy
    Range("QQ10").Select
    Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
        :=False, Transpose:=False
    Range("IX8").Select
 
    Range("IX10:IX1798").Select
    Selection.Copy
    Range("RP10:SO10").Select
    ActiveSheet.Paste
    Application.CutCopyMode = False
    Range("RP10:SO1798").Select
    Selection.Copy
    Range("RP10").Select
    Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
        :=False, Transpose:=False
    Range("IX8").Select


pls help
 
Last edited by a moderator:

Excel Facts

Show numbers in thousands?
Use a custom number format of #,##0,K. Each comma after the final 0 will divide the displayed number by another thousand
Try this

Code:
Sub test6()
  Application.ScreenUpdating = False
  Range("IX10:IX1798").Copy
  Range("IY10:JW10").PasteSpecial xlPasteAll
  Range("IY10:JW10").PasteSpecial xlPasteValues
  
  Range("JX10:KV10").PasteSpecial xlPasteAll
  Range("JX10:KV10").PasteSpecial xlPasteValues


  Range("KW10:LU10").PasteSpecial xlPasteAll
  Range("KW10:LU10").PasteSpecial xlPasteValues


  Range("LV10:MT10").PasteSpecial xlPasteAll
  Range("LV10:MT10").PasteSpecial xlPasteValues
  
  Range("MU10:NS10").PasteSpecial xlPasteAll
  Range("MU10:NS10").PasteSpecial xlPasteValues
  
  Range("NT10:OR10").PasteSpecial xlPasteAll
  Range("NT10:OR10").PasteSpecial xlPasteValues
  
  Range("OS10:PQ10").PasteSpecial xlPasteAll
  Range("OS10:PQ10").PasteSpecial xlPasteValues
  
  Range("PR10:QP10").PasteSpecial xlPasteAll
  Range("PR10:QP10").PasteSpecial xlPasteValues
  
  Range("QQ10:RO10").PasteSpecial xlPasteAll
  Range("QQ10:RO10").PasteSpecial xlPasteValues
  
  Range("RP10:SO10").PasteSpecial xlPasteAll
  Range("RP10:SO10").PasteSpecial xlPasteValues


  Application.ScreenUpdating = True
  Application.CutCopyMode = False
  
  MsgBox "Done"
End Sub
 
Upvote 0
Hi DanteAmor Sir Ji,

Its possible for mention code in thread

1. It will copy the formula
2. After it is paste IX10:IX1798
3. Now for the range IY10 to SO10 automatically paste the formula as per following details
(I) paste in five coloumn
(Ii) copy that five coloumn and paste values
After that it will do for next five coloumns

Because its time taken for counting the ix to so alphabeats
 
Upvote 0

Forum statistics

Threads
1,214,971
Messages
6,122,525
Members
449,088
Latest member
RandomExceller01

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top