VBA for non blank cells

ral_ap

New Member
Joined
Apr 26, 2021
Messages
4
Office Version
  1. 2013
Platform
  1. Windows
Hello. I have two sheets: sheet 1 -"stocks" and the other, 2- "template". I want to determine each non blank value (from column F with multiple rows) from sheet 1 and to put it in sheet number 2 (in cell A9 - till A+). Each non blank value must fill sheet number 2 "template" one by one, on the following empty row

example:
sheet 1 "stocks" - column F
1
(blank)
5
3
7
8
(blank)
4
5

Sheet 2 "template" (how it should look like)
1 (A9 - cell position)
5 (A10)
3 (A11)
7 (A12)
8 (A13)
4 (A14)
5 (A15)


Can anyone help me?
I have started with ----
If Not IsEmpty(Range("F"&i).Value) Then

End if

but i am blocked at putting the values one by one on the next row at sheet "template"
Thank you for your time
 

Excel Facts

Pivot Table Drill Down
Double-click any number in a pivot table to create a new report showing all detail rows that make up that number
unfortunately i am limited at this computer in using certain programs, so i inserted images in order to make myself clearer..
hope it is ok

sheet 1.png
---sheet 1

resulting sheet -template.png
--- resulting sheet 2
 
Upvote 0
Try this Method:
1. Select all Values and Blank cells at column F
2. Press F5 key on KeyBoard
3. Select Special
4. Select Constants
5. Press OK.
6. Press CTRL+C on Keyboard for Copy
7. Go to destination sheet , AND elect Cell A9
8. Press CTRL+V on Keyboard

AND VBA
VBA Code:
Dim Lr as Long
Lr = Sheets("Stocks").Range("F" & Rows.Count).End(xlup).row
Sheets("Stocks").Range("F2:F" & Lr).SpecialCells(xlCellTypeConstants, 23).Copy  Sheets("Template").Range("A9")
 
Upvote 0
i started creating a VBA formula but i got stuck
Thank you for your response
 
Upvote 0
uh . something's not working. the merged cells from the drawing is a problem. i'll return when i can understand what the problem is. Thank you
 
Upvote 0

Forum statistics

Threads
1,214,657
Messages
6,120,777
Members
448,991
Latest member
Hanakoro

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