help for a newbie?

rizzo999

New Member
Joined
Feb 15, 2020
Messages
2
Hi
Newbie here, so be gentle please ;)

I have rows of data from our intranet website copied into consecutive rows of a spreadsheet which then needs cell manipulation. Once they are pasted into spreadsheet, I'd like to have a macro which asks the user to select the group of rows, then it will cut & paste certain cells (always from the same columns) to other columns (which will also be fixed) within the selection. As I'm a novice, I normally just create macros by recording... and below is a recorded macro example of what I need, but its for specific rows. The macro shouldnt interfere with any data above. Hope this is clear.

Rows("27:36").Select
Selection.Hyperlinks.Delete
Range("J27:J36").Select
Selection.Cut
Range("B27").Select
ActiveSheet.Paste
Range("G27:G36").Select
Selection.Cut
Range("D27").Select
ActiveSheet.Paste
Range("E27:L36").Select
Selection.ClearContents

Thankyou
 

Some videos you may like

Excel Facts

Format cells as time
Select range and press Ctrl+Shift+2 to format cells as time. (Shift 2 is the @ sign).

mumps

Well-known Member
Joined
Apr 11, 2012
Messages
10,238
Try:
VBA Code:
Sub CopyRange()
    Application.ScreenUpdating = False
    Dim fRow As Long, lRow As Long
    fRow = InputBox("Enter the row number of the first row.")
    lRow = InputBox("Enter the row number of the last row.")
    Rows(fRow & ":" & lRow).Hyperlinks.Delete
    With ActiveSheet
        .Range("J" & fRow & ":J" & lRow).Cut Range("B" & fRow)
        .Range("G" & fRow & ":G" & lRow).Cut Range("D" & fRow)
        .Range("E" & fRow & ":L" & lRow).ClearContents
    End With
    Application.ScreenUpdating = True
End Sub
 

Watch MrExcel Video

Forum statistics

Threads
1,127,199
Messages
5,623,331
Members
415,968
Latest member
Chabal74

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