Increasing row before the macro runs again

kbk

New Member
Joined
Aug 30, 2024
Messages
2
Office Version
  1. 2010
Platform
  1. Windows
I am a beginner trying to maintain my business data using Excel. I created a macro that copies the information from a sales info table and pastes it into an adjacent table that records the customer's name, items bought, total sales, etc. But when I rerun it the next row is not being used and it copies over itself every time. Can anyone help me with this issue?

This is my current Macro
VBA Code:
Macro4 Macro
'

'
    Range("B1").Select
    Selection.Copy
    Range("N3").Select
    ActiveSheet.Paste
    Range("Table1[QTY SOLD]").Select
    Application.CutCopyMode = False
    Selection.Copy
    Range("O3").Select
    Selection.PasteSpecial Paste:=xlPasteAll, Operation:=xlNone, SkipBlanks:= _
        False, Transpose:=True
    Range("F33").Select
    Application.CutCopyMode = False
    Selection.Copy
    Range("AR3").Select
    Selection.PasteSpecial Paste:=xlPasteAllUsingSourceTheme, Operation:=xlNone _
        , SkipBlanks:=False, Transpose:=False
    Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
        :=False, Transpose:=False
    Application.CutCopyMode = False
    Selection.NumberFormat = "$ #,##0.00"
End Sub
 

Attachments

  • Screenshot 2024-08-30 173215.png
    Screenshot 2024-08-30 173215.png
    31.8 KB · Views: 5
Last edited by a moderator:

Excel Facts

Links? Where??
If Excel says you have links but you can't find them, go to Formulas, Name Manager. Look for old links to dead workbooks & delete.
I tried a different approach but still, the macro is coping over itself.
this is the updated macro

VBA Code:
Macro7 Macro
'

'
    Range("B1").Select
    Selection.Copy
    Sheets("Sheet8").Select
    Range("B2").Select
    ActiveSheet.Paste
    Sheets("DAILY SALES").Select
    Range("Table1[QTY SOLD]").Select
    Application.CutCopyMode = False
    Selection.Copy
    Sheets("Sheet8").Select
    Range("C2").Select
    Selection.PasteSpecial Paste:=xlPasteAll, Operation:=xlNone, SkipBlanks:= _
        False, Transpose:=True
    Sheets("DAILY SALES").Select
    Range("F33").Select
    Application.CutCopyMode = False
    Selection.Copy
    Sheets("Sheet8").Select
    Range("AF2").Select
    Selection.PasteSpecial Paste:=xlPasteAllUsingSourceTheme, Operation:=xlNone _
        , SkipBlanks:=False, Transpose:=False
    Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
        :=False, Transpose:=False
    Columns("AF:AF").EntireColumn.AutoFit
End Sub
 
Last edited by a moderator:
Upvote 0

Forum statistics

Threads
1,221,310
Messages
6,159,176
Members
451,543
Latest member
cesymcox

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