Adjust height of a Cut Row now left blank.

mstuf

Active Member
Joined
Feb 4, 2003
Messages
321
Office Version
  1. 2016
Platform
  1. Windows
This Macro moves a chosen Row to another workbook and pastes it , leaving a blank row in the initial workbook

Code:
Sub OpenToSold5()

   ' Keyboard Shortcut: Ctrl+Shift+W

Dim lRow As Long
Dim lCol As Long
Rows(ActiveCell.Row).Cut
Windows("AMZ-GM Sold.xlsm").Activate
lRow = ActiveSheet.Cells.SpecialCells(xlLastCell).Row 
ActiveSheet.Cells(lRow + 1, 1).Activate 
ActiveSheet.Paste

End Sub

When Completed the Initial Workbook has a Blank Row. When the macro was run the Height of the Row that was Cut is variable ( usually 60 - 120 ) depending on content. But, when completed the remaining blank row is about 8 high. I would like to have it blank at 60 but dont know how to refer to that row in my code to adjust the height of the remaining blank row.

Help to do so would be much appreciated.
Thank You
 

Excel Facts

How to change case of text in Excel?
Use =UPPER() for upper case, =LOWER() for lower case, and =PROPER() for proper case. PROPER won't capitalize second c in Mccartney
See if these additions help.
Rich (BB code):
Sub OpenToSold5()

   ' Keyboard Shortcut: Ctrl+Shift+W

Dim lRow As Long
Dim lCol As Long
Dim lCurrRow As Long
Dim wActSht As Worksheet

Set wActSht = ActiveSheet
lCurrRow = ActiveCell.Row
Rows(ActiveCell.Row).Cut
Windows("AMZ-GM Sold.xlsm").Activate
lRow = ActiveSheet.Cells.SpecialCells(xlLastCell).Row
ActiveSheet.Cells(lRow + 1, 1).Activate
ActiveSheet.Paste
wActSht.Rows(lCurrRow).RowHeight = 20
End Sub
 
Upvote 0
Solution
Works PERFECTLY -

I've learned so much here at this board - and its save me millions of keystrokes but I constantly realize how little I know. I love just reading threads - many are so far over my head but I do pick up ideas and have incorporated some into my spaghetti like macros.
I envy those who truly understand Excel VBA, its so amazing.

Thank You
 
Upvote 0
Works PERFECTLY -

I've learned so much here at this board - and its save me millions of keystrokes but I constantly realize how little I know. I love just reading threads - many are so far over my head but I do pick up ideas and have incorporated some into my spaghetti like macros.
I envy those who truly understand Excel VBA, its so amazing.

Thank You
You're welcome. :)

Stick at it. Remember that we all started of knowing nothing about vba or even Excel. I'm still learning things from this forum too! :)
 
Upvote 0

Forum statistics

Threads
1,214,976
Messages
6,122,541
Members
449,089
Latest member
davidcom

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