VBA Loop help for a few lines of code

CGalavitz

New Member
Joined
Apr 11, 2019
Messages
2
Hello,

I just registered but I've been lurking here a while.

I am trying to teach myself how to loop.

This is the macro I have that I would like to loop.

I believe I have enough info there so you know what I am trying to accomplish.

Thanks a ton

Sub Macro2()
'
' Macro2 Macro
'


'
Sheets("Data").Select
'A40 will continue to go up until blank cell is reached'
Range("A40").Select
Selection.Copy
Sheets("Price Sheet").Select
Range("A1").Select
ActiveSheet.Paste
Range("D3:E3").Select
Application.CutCopyMode = False
Selection.Copy
'CHANGE THE NEXT LINE TO WHERE ITS GOING'
'CELL V1 WILL CONTINUE TO GO UP UNTIL "A40" IS A BLANK CELL'
Range("V1").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Sheets("Data").Select

End Sub
 

Some videos you may like

Excel Facts

Copy a format multiple times
Select a formatted range. Double-click the Format Painter (left side of Home tab). You can paste formatting multiple times. Esc to stop

Fluff

MrExcel MVP, Moderator
Joined
Jun 12, 2014
Messages
53,139
Office Version
  1. 365
Platform
  1. Windows
Hi & welcome to MrExcel.
Can you please explain in words what you are trying to do?
 

CGalavitz

New Member
Joined
Apr 11, 2019
Messages
2
I have a list of part names that I wan't to copy into another sheet that contains a bunch of formulas and charts.

This will give me two values that I then want to copy to a specific location to create a price list.
 

Fluff

MrExcel MVP, Moderator
Joined
Jun 12, 2014
Messages
53,139
Office Version
  1. 365
Platform
  1. Windows
Please remember that we cannot see your workbook, nor can we read your mind. ;)
Can you therefore please try explaining again.
 

Watch MrExcel Video

Forum statistics

Threads
1,122,952
Messages
5,599,033
Members
414,275
Latest member
Pungie

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
Top