Help with moving Data from one WB to another

UMAKEMESIK

Active Member
Joined
Oct 3, 2005
Messages
378
Hello,

We are looking for assistance in moving data from one workbook on the network to another WB on the same Network.

We currently use the code below to move data from the active workbook to Sample Request Log.xlsm.

in the code below we pull data from various cells across the active sheet and place it in Sample Request Log in the Last Available row ( across the row in designated cells)

We would like to Pull data from the Active workbook and move to another workbook but instead of putting all info down on the last available line we would like to dictate exactly what cells the place the data.

I.e. ( see below ) from the active sheet (O12) we would like to place that on the other workbook in cell AB3 and so on for approximately 25-35 cells

below is the existing code that puts all the data on the next (last) available line:

Code:
Dim LastRow As Range
    Dim ws As Worksheet
        Set ws = Sheets("PCA")
        
        
  
        
    Workbooks.Open Filename:="R:\General\SLZ\SloDesign\SAMPLE REQUEST LOG.xlsm", Password:="DOD", WriteResPassword:="DOD"
       
        
        Set LastRow = Sheets("SR LOG").Cells(Rows.Count, 1).End(xlUp)
            
            With LastRow
            
.Offset(1, 0) = ws.[AB3]
                  ActiveSheet.Hyperlinks.Add Anchor:=.Offset(1), _
 Address:="R:\General\SLZ\SloDesign\SAMPLE REQUEST FORMS\" & Range("O12") & "\" & Range("F16") & " - " & Range("O16") & " - " & Range("AB3") & ".xls"
 

  
.Offset(1).Font.Size = 14
             
                .Offset(1, 1) = ws.[O12]
                .Offset(1, 2) = ws.[O14]
                .Offset(1, 3) = ws.[F16]
                .Offset(1, 4) = ws.[O16]
                .Offset(1, 5) = ws.[AB12]
                .Offset(1, 6) = ws.[AB14]
                .Offset(1, 7) = ws.[F32]
                .Offset(1, 8) = ws.[AB16]
                .Offset(1, 9) = ws.[AB18]
                .Offset(1, 10) = ws.[P28]
            
            End With
            


          
        
    
     ActiveWorkbook.Save
    



    Application.ScreenUpdating = True
 
     
     
Application.Quit

Any help would be much appreciated.
 

Excel Facts

Get help while writing formula
Click the italics "fx" icon to the left of the formula bar to open the Functions Arguments dialog. Help is displayed for each argument.
Try this>


Code:
Sub moving_Data_from_WB()
    Dim LastRow As Range
    Dim ws As Worksheet[COLOR=#0000ff], ws2 as Worksheet[/COLOR]
    Set ws = Sheets("PCA")
    
    Workbooks.Open Filename:="R:\General\SLZ\SloDesign\SAMPLE REQUEST LOG.xlsm", Password:="DOD", WriteResPassword:="DOD"
[COLOR=#0000ff]    Set ws2 = Sheets("SR LOG")[/COLOR]
    
    With ws2
        [COLOR=#0000ff].Range("AB3").Value[/COLOR] = ws.[AB3]
        ActiveSheet.Hyperlinks.Add Anchor:=.Offset(1), _
            Address:="R:\General\SLZ\SloDesign\SAMPLE REQUEST FORMS\" & Range("O12") & "\" & Range("F16") & " - " & Range("O16") & " - " & Range("AB3") & ".xls"
        [COLOR=#0000ff].Range("AB3")[/COLOR].Font.Size = 14
        [COLOR=#0000ff].Range("AB4").Value[/COLOR] = ws.[O12]
        [COLOR=#0000ff].Range("AB5").Value[/COLOR] = ws.[O14]
        .Range("AB6").Value = ws.[F16]
        .Range("AC3").Value = ws.[O16]
        .Range("AC4").Value = ws.[AB12]
        .Range("AC5").Value = ws.[AB14]
        .Range("AC6").Value = ws.[F32]
        .Range("AD3").Value = ws.[AB16]
        .Range("AD4").Value = ws.[AB18]
        .Range("AD5").Value = ws.[P28]
        'And continues with the other cells
        '...
    End With
    ActiveWorkbook.Save
    Application.ScreenUpdating = True
    'Application.Quit
End Sub
 
Upvote 0
Thanks for taking the time.
Was able to modify to fit our needs.

this was a live saver and we are
not furthering our development process.

thanks again.














Try this>


Code:
Sub moving_Data_from_WB()
    Dim LastRow As Range
    Dim ws As Worksheet[COLOR=#0000ff], ws2 as Worksheet[/COLOR]
    Set ws = Sheets("PCA")
    
    Workbooks.Open Filename:="R:\General\SLZ\SloDesign\SAMPLE REQUEST LOG.xlsm", Password:="DOD", WriteResPassword:="DOD"
[COLOR=#0000ff]    Set ws2 = Sheets("SR LOG")[/COLOR]
    
    With ws2
        [COLOR=#0000ff].Range("AB3").Value[/COLOR] = ws.[AB3]
        ActiveSheet.Hyperlinks.Add Anchor:=.Offset(1), _
            Address:="R:\General\SLZ\SloDesign\SAMPLE REQUEST FORMS\" & Range("O12") & "\" & Range("F16") & " - " & Range("O16") & " - " & Range("AB3") & ".xls"
        [COLOR=#0000ff].Range("AB3")[/COLOR].Font.Size = 14
        [COLOR=#0000ff].Range("AB4").Value[/COLOR] = ws.[O12]
        [COLOR=#0000ff].Range("AB5").Value[/COLOR] = ws.[O14]
        .Range("AB6").Value = ws.[F16]
        .Range("AC3").Value = ws.[O16]
        .Range("AC4").Value = ws.[AB12]
        .Range("AC5").Value = ws.[AB14]
        .Range("AC6").Value = ws.[F32]
        .Range("AD3").Value = ws.[AB16]
        .Range("AD4").Value = ws.[AB18]
        .Range("AD5").Value = ws.[P28]
        'And continues with the other cells
        '...
    End With
    ActiveWorkbook.Save
    Application.ScreenUpdating = True
    'Application.Quit
End Sub
 
Upvote 0
I'm glad to help you. Thanks for the feedback.
 
Upvote 0

Forum statistics

Threads
1,223,950
Messages
6,175,584
Members
452,653
Latest member
craigje92

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