problem transfer data from sheet to another

abdelfattah

Well-known Member
Joined
May 3, 2019
Messages
1,430
Office Version
  1. 2019
  2. 2010
Platform
  1. Windows
hello

i have this code to transfer data from sheet to another the problem when i fill data more than brand in my invoice it only transfers one row while i have more than two rows it supposes transferring theses rows to another sheet i no know where is the problem
VBA Code:
Sub REDA()
 Application.ScreenUpdating = False
    
    Dim iRow As Long
    
    
    iRow = Sheets("sls").Range("C1048576").End(xlUp).Row + 1
    
    
        With ThisWorkbook.Sheets("SLS")
        
           .Range("B" & iRow).Value = iRow - 1
           .Range("C" & iRow).Value = Sheets("INV").Range("D7").Value
           .Range("D" & iRow).Value = Sheets("INV").Range("D8").Value
           .Range("E" & iRow).Value = Sheets("INV").Range("C14").Value
           .Range("F" & iRow).Value = Sheets("INV").Range("D14").Value
           .Range("G" & iRow).Value = Sheets("INV").Range("E14").Value
           .Range("H" & iRow).Value = Sheets("INV").Range("F14").Value
           .Range("I" & iRow).Value = Sheets("INV").Range("G14").Value
           .Range("J" & iRow).Value = Sheets("INV").Range("G24").Value
           .Range("K" & iRow).Value = Sheets("INV").Range("G25").Value
           .Range("L" & iRow).Value = Sheets("INV").Range("G26").Value
           .Range("M" & iRow).Value = Sheets("INV").Range("G27").Value
        
          
          
        End With
        end sub
 
now it works but what about the format i mean the chart is not lining as rest of column as existed above image and i have simple thing can i adjusting about total if is possible it became like this every process
1.JPG
 
Upvote 0

Excel Facts

Why are there 1,048,576 rows in Excel?
The Excel team increased the size of the grid in 2007. There are 2^20 rows and 2^14 columns for a total of 17 billion cells.
The formatting of the table changed because some of the columns we are using Copy/Paste, and that is bringing over the formatting.
I would just recommend adding a few lines of code at the end to remove the formatting that you don't like.
You should be able to get the formatting changes you want by turning on your Macro Recorder, and record yourself making the changes manually.
Then, if you stop the Macro Recorder, you can see the code you created, and you can incorporate that at the end of your code.
 
Upvote 0
thanks Joe for your advice and i appreciate for your efforts and time i can say no your code works perfectly
 
Upvote 0
Excellent! Glad to hear it!
:)
 
Upvote 0

Forum statistics

Threads
1,215,701
Messages
6,126,297
Members
449,308
Latest member
VerifiedBleachersAttendee

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