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
 

Excel Facts

Format cells as date
Select range and press Ctrl+Shift+3 to format cells as date. (Shift 3 is the # sign which sort of looks like a small calendar).
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
 
Upvote 0

Forum statistics

Threads
1,214,918
Messages
6,122,246
Members
449,075
Latest member
staticfluids

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