:D snasui.com ยินดีต้อนรับ :D
ยินดีต้อนรับสู่กระดานถามตอบ Excel and VBA และอื่น ๆ ที่เป็นมิตรกับทุกท่าน มีไฟล์แนบมหาศาล ช่วยให้ท่านค้นหาและติดตามศึกษาได้โดยง่าย :thup: สมาชิกท่านใดที่ยังไม่ได้ระบุ Version ของ Excel ที่ใช้งานจริง สามารถทำตาม Link นี้เพื่อจะได้รับคำตอบที่ตรงกับ Version ของท่านครับ :arrow: ระบุ Version ของ Excel
:!: โปรดทราบ :!:
  1. กรุณาอ่านกฎการใช้บอร์ด (Forum rules) ในตำแหน่งด้านบนของแต่ละบอร์ด
  2. การสมัครสมาชิก การ Login การกู้คืนรหัสผ่าน
    1. สมัครสมาชิกดูขั้นตอนได้ที่ :arrow: สมัครสมาชิก
    2. Login เข้าระบบโดยคลิกปุ่ม Login ตรงมุมขวาบนของหน้านี้ :roll:
    3. การ Login ผ่าน Facebook ดูวิธีที่ :arrow: Login ผ่าน Facebook
    4. ลืมรหัสผ่านสามารถรับรหัสใหม่ได้ที่ :arrow: Reset รหัสผ่าน
  3. มีปัญหาการใช้งาน แจ้งผู้ดูแลระบบได้ที่ :arrow: ติดต่อผู้ดูแลระบบ
  4. กำหนดการตั้งค่าส่วนตัว เช่นตั้งค่าภาษาเป็นไทยหรืออังกฤษดูได้ที่ :arrow: ตั้งค่าส่วนตัว
  5. การตั้งและตอบกระทู้ดูได้ที่ :arrow: วิธีการตั้งและตอบกระทู้
  6. การจัดรูปแบบตัวอักษรด้วย bbcode ในช่องแสดงความคิดเห็นดูได้ที่ :arrow: จัดรูปแบบตัวอักษร
  7. กำหนดขนาดตัวอักษรใน Browser ดูได้ที่ :arrow: กำหนดขนาดตัวอักษรใน Browser

JV

ฟอรัมถาม-ตอบปัญหาการใช้งานสูตรและฟังก์ชัน Excel
Forum rules
  1. ไม่อนุญาตให้ใช้ภาษาแชทในการถามและตอบปัญหา ไม่ใช้คำว่า "คับ" หรือ "อ่ะครับ" แทนคำว่า "ครับ" ไม่ใช้คำว่า "เด๋ว" แทนคำว่า "เดี๋ยว" เป็นต้น เนื่องจากเมื่อแปลเป็นภาษาต่างประเทศแล้วจะให้ความหมายผิดไปจากที่ควรจะเป็น
  2. ห้ามถามโดยระบุชื่อผู้ตอบและต้องตั้งชื่อกระทู้ให้สื่อถึงปัญหาที่จะถาม ไม่ตั้งชื่อว่า ช่วยด้วยครับ, มีปัญหามาปรึกษาครับ เป็นต้น
  3. กรุณาอธิบายปัญหาและระบุคำตอบที่ต้องการมาในกระทู้ด้วยเสมอถึงแม้จะอธิบายไว้ในไฟล์แนบแล้วก็ตาม ทั้งนี้เพื่ออำนวยความสะดวกแก่เพื่อนสมาชิกในการค้นหาข้อมูล
  4. กรุณาแนบไฟล์ตัวอย่างพร้อมแสดงคำตอบที่ถูกต้องมาในไฟล์ด้วยเพื่อให้ง่ายต่อการทำความเข้าใจและสะดวกต่อการตอบคำถาม (ขนาดไฟล์ไม่เกิน 500Kb ขนาดภาพไม่เกิน 800*600 Pixel) ไม่แนบเป็น Link มาจากแหล่งอื่นที่อาจจะถูกลบทิ้งไปโดยต้นทางในภายหลัง นอกจากนี้ไม่ควรแนบไฟล์ที่มีข้อมูลสำคัญอันก่อให้เกิดความเสียหายกับตนเองและผู้อื่น
  5. กรณีเป็นคำถามเกี่ยวกับ Programming เช่น VBA, VB.Net, C#, SQL ฯลฯ ต้องลองเขียนมาเองก่อนเสมอ ถามเฉพาะที่ติดปัญหา ระบุ Module, Procedure ที่ติดปัญหาให้ชัดเจน กรุณาโพสต์ Code ให้แสดงเป็น Code คือเปิดด้วย [code] และปิดด้วย [/code] ตัวอย่างเช่น [code]dim r as range[/code] เพื่อให้แตกต่างจากข้อความทั่วไป สะดวกในการอ่านและทดสอบ (คลิกเพื่อดูตัวอย่าง)
  6. กรุณาแจ้งผลการใช้งานเมื่อได้รับคำตอบว่าตรงกับความต้องการหรือไม่
sna
Silver
Silver
Posts: 721
Joined: Tue May 05, 2020 8:18 am
Excel Ver: Excel 365

JV

#1

Post by sna »

Hi Dear

I need to show the result as in attached file in Menu Sheet Column K To L

Thanks
sna
Silver
Silver
Posts: 721
Joined: Tue May 05, 2020 8:18 am
Excel Ver: Excel 365

Re: JV

#2

Post by sna »

Herewith attached
You do not have the required permissions to view the files attached to this post.
User avatar
snasui
Site Admin
Site Admin
Posts: 31253
Joined: Sun Jan 24, 2010 12:33 pm
Location: Songkhla, Thailand
Excel Ver: 2010, 2019
Contact:

Re: JV

#3

Post by snasui »

:D Please provide source of data and show its result for easy to understand then attach the updated file again.
sna
Silver
Silver
Posts: 721
Joined: Tue May 05, 2020 8:18 am
Excel Ver: Excel 365

Re: JV

#4

Post by sna »

Hi Dear
Sorry for not clear explanation.
The source data is in Sheet Menu.The data from B11:Ixx coming from Source C1:C8 data entries.the main point of this template I want to create accrued expenses tracking by inputing data in Sheet Menu including PL Code and GL Code but the PL and GL in the same line(row) but in the JV it should be line separately.it means Dr PL(exp) and Cr GL(accrued expenses) and it should be like K10:M13.in JV sheet
Debit Credit amount
61095 100
USD17223 (100)


Thanks
User avatar
snasui
Site Admin
Site Admin
Posts: 31253
Joined: Sun Jan 24, 2010 12:33 pm
Location: Songkhla, Thailand
Excel Ver: 2010, 2019
Contact:

Re: JV

#5

Post by snasui »

:D The example code is below:

Code: Select all

Dim n As Long, t As Long
With S1
    t = .Range("h" & .Rows.Count).End(xlUp).Row + 1
    .Range("b" & t).Resize(1, 6).Value = _
        Application.Transpose(.Range("c1:c6").Value)
    .Range("h" & t + 1).Value = .Range("c7").Value
    .Range("c1:c8").ClearContents
    .Range("c1").Select
End With
sna
Silver
Silver
Posts: 721
Joined: Tue May 05, 2020 8:18 am
Excel Ver: Excel 365

Re: JV

#6

Post by sna »

Hi Dear
Thank.got it but once more I need to click button JV it will copy data to JV as in attached
I attached new sheet

Best wishes
You do not have the required permissions to view the files attached to this post.
User avatar
snasui
Site Admin
Site Admin
Posts: 31253
Joined: Sun Jan 24, 2010 12:33 pm
Location: Songkhla, Thailand
Excel Ver: 2010, 2019
Contact:

Re: JV

#7

Post by snasui »

:D Try with this code:

Code: Select all

Dim r As Range
S1.Range("g11:h1000").Copy S2.Range("a11")
S1.Range("d11:d1000").Copy S2.Range("d11")
For Each r In S2.Range("d11:d" & S2.Range("d" & S2.Rows.Count).End(xlUp).Row + 1)
    If r.Value = "" Then
        r.Value = -r.Offset(-1, 0).Value
    End If
Next r
S1.Range("e11:e1000").Copy S2.Range("e11")
For Each r In S2.Range("e11:e" & S2.Range("e" & S2.Rows.Count).End(xlUp).Row + 1)
    If r.Value = "" Then
        r.Value = r.Offset(-1, 0).Value
    End If
Next r
sna
Silver
Silver
Posts: 721
Joined: Tue May 05, 2020 8:18 am
Excel Ver: Excel 365

Re: JV

#8

Post by sna »

Code: Select all

Range("C11").FormulaR1C1="IFERROR(VLOOKUP (IF(RC[-1]="""",RC[-2],RC[-1]),table1,2,0),"""")"
Range("C11:C1000").AutoFill Destination:=Range("C11:C1000")
Thank you so much . another way I use above code to add to your code but
In your code provided,I need to look up account name from PL or GL in Sheet Journal but don't require formula just values


Best Regards,
sna
Silver
Silver
Posts: 721
Joined: Tue May 05, 2020 8:18 am
Excel Ver: Excel 365

Re: JV

#9

Post by sna »

Hi dear

I update a file by creating a code to copy data from S1 To S4 but it has blank rows and another one is Vlookup account name in S2.

Could you please kindly take a look?


Best Regards
You do not have the required permissions to view the files attached to this post.
User avatar
snasui
Site Admin
Site Admin
Posts: 31253
Joined: Sun Jan 24, 2010 12:33 pm
Location: Songkhla, Thailand
Excel Ver: 2010, 2019
Contact:

Re: JV

#10

Post by snasui »

sna wrote: Tue Nov 17, 2020 9:26 am I need to look up account name from PL or GL in Sheet Journal but don't require formula just values
:D Copy your code and paste as values with this line after auto fill.

Code: Select all

Range("C11:C19").value = Range("C11:C19").value
sna
Silver
Silver
Posts: 721
Joined: Tue May 05, 2020 8:18 am
Excel Ver: Excel 365

Re: JV

#11

Post by sna »

I mean I want to copy from Sheet menu to sheet Listing base on header.in JV I need to look up account name from COA but my code not work well in Module 2 and 3
User avatar
snasui
Site Admin
Site Admin
Posts: 31253
Joined: Sun Jan 24, 2010 12:33 pm
Location: Songkhla, Thailand
Excel Ver: 2010, 2019
Contact:

Re: JV

#12

Post by snasui »

:D Please attach file with the latest code (include my code above) and explain what the correct result that you want.
sna
Silver
Silver
Posts: 721
Joined: Tue May 05, 2020 8:18 am
Excel Ver: Excel 365

Re: JV

#13

Post by sna »

I need to copy from data in sheet Menu to Sheet Listing without blank rows base on column headers.fill account name in Sheet Journal as in Sample attached file

Thanks
sna
Silver
Silver
Posts: 721
Joined: Tue May 05, 2020 8:18 am
Excel Ver: Excel 365

Re: JV

#14

Post by sna »

Here is an attachment
You do not have the required permissions to view the files attached to this post.
sna
Silver
Silver
Posts: 721
Joined: Tue May 05, 2020 8:18 am
Excel Ver: Excel 365

Re: JV

#15

Post by sna »

I upload sample with expected Result and code update in Book1(3).xlsm

In Sheet Listing I need to copy data from Sheet Menu matching column headers in Sheet Listing and paste here.In Sheet JV I need to look up account name from Sheet COA by using Vlookup in vba and convert to values.

Hope everything is fine tune

Thanks
sna
Silver
Silver
Posts: 721
Joined: Tue May 05, 2020 8:18 am
Excel Ver: Excel 365

Re: JV

#16

Post by sna »

Hi Dear ,
Now come up with issue.I have withholding tax so how do I amend code to be like in Sheet Menu and Sheet Journal.I mean as soon as I put data entry click button add it will show like Menu and I click journal button it will show as journal sheet.
please kindly help
Thank in advance
sna
Silver
Silver
Posts: 721
Joined: Tue May 05, 2020 8:18 am
Excel Ver: Excel 365

Re: JV

#17

Post by sna »

Here is a new update template
You do not have the required permissions to view the files attached to this post.
User avatar
snasui
Site Admin
Site Admin
Posts: 31253
Joined: Sun Jan 24, 2010 12:33 pm
Location: Songkhla, Thailand
Excel Ver: 2010, 2019
Contact:

Re: JV

#18

Post by snasui »

:D Please adjust sub procedure named AddNew() by yourself first if it has any problem you can post that code and attach the latest file again.
sna
Silver
Silver
Posts: 721
Joined: Tue May 05, 2020 8:18 am
Excel Ver: Excel 365

Re: JV

#19

Post by sna »

Now my template intuitive change.just close it
BTW thanks you so much
Post Reply