Copy every row from sheet 2 to every 25th row in sheet1 in excel
Sheet I want the information in:
[ATTACH=CONFIG]71816[/ATTACH]
Sheet I am getting the codes from:
[ATTACH=CONFIG]71817[/ATTACH]
Please note that on 14th December 2023 users will experience an expected outage whilst we make upgrades to our network. We anticipate this process may take a couple of hours and so we apologise in advance for any inconvenience.
Copy every row from sheet 2 to every 25th row in sheet1 in excel
Sheet I want the information in:
[ATTACH=CONFIG]71816[/ATTACH]
Sheet I am getting the codes from:
[ATTACH=CONFIG]71817[/ATTACH]
Re: Import codes from once sheet to the other
Hi.. a sample workbook in an excel forum is ALWAYS more preferred than an image..
Plus you chopped off the column and row numbers..
In any case.. something like this.. adapt as needed..
Re: Import codes from once sheet to the other
My apologies - I just joined. Will keep this in mind.
.. and thank you - I will test this.
Re: Import codes from once sheet to the other
No worries.. welcome o OzGrid!
btw.. probably better to post a question like this in the Main Help Forum > Excel VBA/Macros.. you will get a lot more helpers seeing it..
Re: Import codes from once sheet to the other
Great - thank you.
Re: Import codes from once sheet to the other
Hi. This is not working - please advise what I am doing wrong.
https://1drv.ms/x/s!AskK8ngh660bgbNuooNMWwBsaWCc0w
The data from sheet: "SubstoreBuyPlan" should show in every 25th row in "SubstoreProductMaster"
Sub ImportProdCode()
Dim x, i As Long, cnt As Long
x = Application.Transpose(SubstoreBuyPlan.Range("A2:A" & SubstoreBuyPlan.Range("A" & Rows.Count).End(xlUp).Row))
cnt = 1
For i = LBound(x) To UBound(x)
SubstoreProductMaster.Cells(i + cnt, 1).Value = x(i)
cnt = cnt + 25
Next i
Application.ScreenUpdating = True
Application.Calculation = xlCalculationAutomatic
End Sub
Display More
Re: Import codes from once sheet to the other
Hi..
Please put code tags around any code you post. (When in the Reply box.. highlight your code and click the little # icon in the Reply box menu bar). I have done it for you in your last post.
Sub ImportProdCode()
Dim x, i As Long, cnt As Long
x = Application.Transpose(Sheets("SubstoreBuyPlan").Range("A2:A" & Sheets("SubstoreBuyPlan").Range("A" & Rows.Count).End(xlUp).Row))
cnt = 1
For i = LBound(x) To UBound(x)
Sheets("SubstoreProductMaster").Cells(i + cnt, 1).Value = x(i)
cnt = cnt + 24
Next i
End Sub
You had a couple of issues when you adapted the code i gave you.
1. The way you are referencing your Worksheets would require you to Declare and Set them first. I may have confused you in that the way I referenced them in the initial code was by the sheets index number. IN the second code I show how to reference it by sheet name (one way)..
2. Your missing the part where you should turn screenupdating to False at the start of your code.
3. Not that I think you need to do this.. but you are setting the calculation mode to automatic at the end but not setting it to manual at the start.. so it is pointless.
Lemme know how you go.
Re: Import codes from once sheet to the other
Success! You are my favourite person today! Thank you sooo much.
Don’t have an account yet? Register yourself now and be a part of our community!