VBA code to copy cell value

sunilobo

New Member
Joined
Mar 29, 2021
Messages
10
Office Version
  1. 2010
Platform
  1. Windows
I need help in VBA code to copy cell value from rows of the sheet1 to other worksheets in the same workbook

Sheet1 - A5 to sheet2-F10
Sheet1 - A6 to sheet3-F10
Sheet1 - A7 to sheet4-F10

Thanks in advance
 
So do you mean there is no table with N's & sheets names & the destination F10?
Do you want hard codded all of them?
 
Upvote 0

Excel Facts

Format cells as currency
Select range and press Ctrl+Shift+4 to format cells as currency. (Shift 4 is the $ sign).
May be
VBA Code:
Sub test1()
    a = Array("B1-001", "B1-002", "B1-101", "B1-102", "B1-201", "B1-202")
    For i = 0 To UBound(a)
        With Sheets(a(i)).Range("F10")
          .Value = Sheets("sheet1").Range("N" & i + 8)
        End With
    Next
End Sub
 
Upvote 0
Thank you so much it is working now. It is really great help.

I need to convert these worksheets in PDF and save them on my computer do you have a VBA code for it. Thanks for the help again
 
Upvote 0
VBA Code:
Sub test1()
    a = Array("B1-001", "B1-002", "B1-101", "B1-102", "B1-201", "B1-202")
    For i = 0 To UBound(a)
        With Sheets(a(i)).Range("F10")
          .Value = Sheets("sheet1").Range("N" & i + 8)
          .Parent.ExportAsFixedFormat Type:=xlTypePDF, Filename:= _
                                        "C:\" & a(i) & ".pdf" _
                                        , Quality:=xlQualityStandard, IncludeDocProperties:=True
        End With
    Next
End Sub
This to save PDF's on C Dirve Change "C:\"as you wish
 
Upvote 0
You are welcome
And thank you for the feedback
Be happy & safe
 
Upvote 0
You are welcome
And thank you for the feedback
Be happy & safe
You are welcome
And thank you for the feedback
Be happy & safe
I am doing something wrong can you please the path

Sub test1()
a = Array("B1-001", "B1-002", "B1-101", "B1-102", "B1-201", "B1-202")
For i = 0 To UBound(a)
With Sheets(a(i)).Range("F10")
.Value = Sheets("sheet1").Range("N" & i + 8)
.Parent.ExportAsFixedFormat Type:=xlTypePDF, FileName:= _
"C:\"\Users\sunil\Desktop\Solitude/Billing" _
, Quality:=xlQualityStandard, IncludeDocProperties:=True
End With
Next
End Sub
 
Upvote 0
VBA Code:
"C:\Users\sunil\Desktop\Solitude/Billing\" & a(i) & ".pdf"
 
Upvote 0

Forum statistics

Threads
1,214,376
Messages
6,119,179
Members
448,871
Latest member
hengshankouniuniu

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